docs: Debugging macro test fail

Call yosys-config post build extraction for sanity check.
Report absolute path for yosys exe if it can't be found.
This commit is contained in:
Krystine Sherwin 2024-03-21 11:02:18 +13:00
parent 112a5cfc67
commit 6f602e79d4
No known key found for this signature in database
2 changed files with 46 additions and 4 deletions

View File

@ -72,8 +72,9 @@ jobs:
test-yosys:
name: Run tests
needs: build-yosys
runs-on: ${{ matrix.os }}
needs: [build-yosys, pre_job]
if: needs.pre_job.outputs.should_skip != 'true'
env:
CC: clang
strategy:
@ -122,6 +123,10 @@ jobs:
run:
tar -xvf build.tar
- name: Log yosys-config output
run: |
./yosys-config || true
- name: Run tests
shell: bash
run: |
@ -132,3 +137,39 @@ jobs:
shell: bash
run: |
find tests/**/*.err -print -exec cat {} \;
test-docs:
name: Run docs tests
runs-on: ${{ matrix.os }}
needs: [build-yosys, pre_job]
if: needs.pre_job.outputs.should_skip != 'true'
env:
CC: clang
strategy:
matrix:
os: [ubuntu-20.04, macos-13]
steps:
- name: Checkout Yosys
uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-build-env
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-${{ matrix.os }}
- name: Uncompress build
shell: bash
run:
tar -xvf build.tar
- name: Log yosys-config output
run: |
./yosys-config || true
- name: Run tests
shell: bash
run: |
make -C docs test -j${{ env.procs }}

View File

@ -12,12 +12,13 @@ logging.basicConfig(level=logging.INFO)
# expects __file__ = yosys/docs/tests/macro_commands.py
TESTS_DIR = Path(__file__).parent
ROOT_DIR = TESTS_DIR.parent.parent
logging.log(logging.INFO, f"Using {ROOT_DIR.absolute()} as root directory")
THIS_FILE = (TESTS_DIR / "macro_commands.py").relative_to(ROOT_DIR)
MACRO_SOURCE = TESTS_DIR.parent / "source" / "code_examples" / "macro_commands"
assert MACRO_SOURCE.exists(), f"can't find macro_commands in {MACRO_SOURCE}"
assert MACRO_SOURCE.exists(), f"can't find macro_commands in {MACRO_SOURCE.absolute()}"
YOSYS = TESTS_DIR.parent.parent / "yosys"
assert YOSYS.exists(), f"can't find yosys executable in {YOSYS}"
YOSYS = ROOT_DIR / "yosys"
assert YOSYS.exists(), f"can't find yosys executable in {YOSYS.absolute()}"
raise_error = False
# get all macro commands being used