diff --git a/.copier-answers.yaml b/.copier-answers.yaml index 169e313..fb6e0f5 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: c2ea129 +_commit: b2cdb6d _src_path: https://github.com/python-project-templates/base.git add_docs: true add_extension: python diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f4f56e1..75b168a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -33,68 +33,73 @@ jobs: python-version: ["3.11"] steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - uses: actions-ext/python/setup@6e1b91a408ea89f49bc8aff8724f83826f7b5446 - with: - version: ${{ matrix.python-version }} - - - name: Install dependencies - run: make develop - - - name: Install synthesis tools (yosys + yosys-slang) - run: | - gh release download v0.0.13 --repo dau-dev/tools --pattern 'yosys_*.deb' --pattern 'yosys-slang_*.deb' --dir /tmp/tools - sudo apt-get update - sudo apt-get install -y /tmp/tools/yosys_*.deb /tmp/tools/yosys-slang_*.deb - yosys --version - yosys -m slang -p 'help read_slang' >/dev/null && echo "yosys-slang plugin OK" - env: - GH_TOKEN: ${{ github.token }} - - - name: Lint - run: make lint - - - name: Checks - run: make checks - - - name: Build - run: make build - - - name: Test - run: make coverage - - - name: Upload test results (Python) - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: test-results-${{ matrix.os }}-${{ matrix.python-version }} - path: junit.xml - if: ${{ always() }} - - - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0 - with: - files: '**/junit.xml' - - - name: Upload coverage - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Make dist - run: make dist - - - uses: actions-ext/python/test-wheel@6e1b91a408ea89f49bc8aff8724f83826f7b5446 - with: - module: dau_build - - - uses: actions-ext/python/test-sdist@6e1b91a408ea89f49bc8aff8724f83826f7b5446 - with: - module: dau_build - - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dist-${{matrix.os}} - path: dist + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Setup Python + uses: actions-ext/python/setup@6e1b91a408ea89f49bc8aff8724f83826f7b5446 + with: + version: ${{ matrix.python-version }} + + - name: Install dependencies + run: make develop + + - name: Install synthesis tools (yosys + yosys-slang) + run: | + gh release download v0.0.13 --repo dau-dev/tools --pattern 'yosys_*.deb' --pattern 'yosys-slang_*.deb' --dir /tmp/tools + sudo apt-get update + sudo apt-get install -y /tmp/tools/yosys_*.deb /tmp/tools/yosys-slang_*.deb + yosys --version + yosys -m slang -p 'help read_slang' >/dev/null && echo "yosys-slang plugin OK" + env: + GH_TOKEN: ${{ github.token }} + + - name: Lint + run: make lint + + - name: Checks + run: make checks + + - name: Build + run: make build + + - name: Test + run: make coverage + + - name: Upload test results (Python) + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: test-results-${{ matrix.os }}-${{ matrix.python-version }} + path: junit.xml + if: ${{ always() }} + + - name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0 + with: + files: '**/junit.xml' + + - name: Upload coverage + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Build distributions + run: make dist + + - name: Test wheel + uses: actions-ext/python/test-wheel@6e1b91a408ea89f49bc8aff8724f83826f7b5446 + with: + module: dau_build + + - name: Test source distribution + uses: actions-ext/python/test-sdist@6e1b91a408ea89f49bc8aff8724f83826f7b5446 + with: + module: dau_build + + - name: Upload distributions + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: dist-${{matrix.os}} + path: dist diff --git a/.github/workflows/copier.yaml b/.github/workflows/copier.yaml index a936d5f..7171411 100644 --- a/.github/workflows/copier.yaml +++ b/.github/workflows/copier.yaml @@ -12,6 +12,7 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions-ext/copier-update@378500315a83b5985e175139a55f1fa5ea6dde09 - with: - token: ${{ secrets.WORKFLOW_TOKEN }} + - name: Update from Copier + uses: actions-ext/copier/update@2061209faa6b75ffd4fcecc0b0983772767997f4 + with: + token: ${{ secrets.WORKFLOW_TOKEN }} diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 311750d..b263cd9 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -16,40 +16,44 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - uses: actions-ext/python/setup@6e1b91a408ea89f49bc8aff8724f83826f7b5446 - - - name: Download dist from build - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 - with: - pattern: dist-ubuntu-latest* - merge-multiple: true - path: dist - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.repository }} - if: github.event_name == 'workflow_run' - - - name: Install from wheel - run: | - uv pip install dist/*.whl - uv pip install dist/*.whl --target . --no-deps - uv pip install yardang - if: github.event_name == 'workflow_run' - - - name: Install from source (manual trigger) - run: | - uv pip install .[develop] - uv pip install yardang - if: github.event_name == 'workflow_dispatch' - - - run: yardang build - - - uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 - with: - publish_branch: gh-pages - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/html + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Setup Python + uses: actions-ext/python/setup@6e1b91a408ea89f49bc8aff8724f83826f7b5446 + + - name: Download distributions + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + pattern: dist-ubuntu-latest* + merge-multiple: true + path: dist + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + if: github.event_name == 'workflow_run' + + - name: Install from wheel + run: | + uv pip install dist/*.whl + uv pip install dist/*.whl --target . --no-deps + uv pip install yardang + if: github.event_name == 'workflow_run' + + - name: Install from source (manual trigger) + run: | + uv pip install .[develop] + uv pip install yardang + if: github.event_name == 'workflow_dispatch' + + - name: Build documentation + run: yardang build + + - name: Publish documentation + uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/html diff --git a/dau_build/tests/test_hardware_plan.py b/dau_build/tests/test_hardware_plan.py index f67a9b4..30510c1 100644 --- a/dau_build/tests/test_hardware_plan.py +++ b/dau_build/tests/test_hardware_plan.py @@ -1196,6 +1196,7 @@ def fake_run(argv, check=False): calls.append(tuple(argv)) return Completed(return_codes[len(calls) - 1]) + monkeypatch.setattr(hardware_plan.shutil, "which", lambda executable: f"/resolved/{executable}") monkeypatch.setattr(hardware_plan.subprocess, "run", fake_run) with pytest.raises(BuildStepError, match="exit code 23"): diff --git a/dau_build/tests/test_scan_composition.py b/dau_build/tests/test_scan_composition.py index 714ee1a..a3fd863 100644 --- a/dau_build/tests/test_scan_composition.py +++ b/dau_build/tests/test_scan_composition.py @@ -1181,12 +1181,12 @@ def test_a_wide_job_master_can_actually_reach_its_high_address_bits() -> None: def test_the_wide_address_registers_sit_where_dau_core_says() -> None: """The walker's offsets mirror `dau_core.registers`; a drift here means the host writes one address and the design decodes another.""" - from dau_core.registers import NocLaneRegisterOffset, RegisterOffset + registers = pytest.importorskip("dau_core.registers") from dau_build.scan_composition import RegisterLayout regs = RegisterLayout() - assert regs.input_address_high == int(RegisterOffset.INPUT_ADDRESS_HIGH) - assert regs.lane_output_address_high == int(NocLaneRegisterOffset.OUTPUT_ADDRESS_HIGH) + assert regs.input_address_high == int(registers.RegisterOffset.INPUT_ADDRESS_HIGH) + assert regs.lane_output_address_high == int(registers.NocLaneRegisterOffset.OUTPUT_ADDRESS_HIGH) # and the lane high register stays inside the lane stride assert regs.lane_output_address_high < regs.lane_stride