From 6f602e79d4abe113eff11d61d9072e18a4bf6733 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:02:18 +1300 Subject: [PATCH] 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. --- .github/workflows/test-build.yml | 43 +++++++++++++++++++++++++++++++- docs/tests/macro_commands.py | 7 +++--- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index cdc19b0e3..605ce570d 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -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 }} diff --git a/docs/tests/macro_commands.py b/docs/tests/macro_commands.py index faf2baa53..d879e4365 100755 --- a/docs/tests/macro_commands.py +++ b/docs/tests/macro_commands.py @@ -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