Fix decoding of multi-element register payloads #134
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: harp | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| publish-docs-website: | |
| description: "Publish docs website to GitHub Pages?" | |
| default: "false" | |
| jobs: | |
| # ---- Tests ---- | |
| tests: | |
| name: Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ["3.11", "3.12", "3.13"] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v8.3.2 | |
| with: | |
| enable-cache: true | |
| - name: Install python dependencies | |
| run: uv sync --group dev --python ${{ matrix.python-version }} | |
| - name: Run codespell | |
| run: uv run codespell | |
| - name: Run ruff format | |
| run: uv run ruff format --check | |
| - name: Run ruff check | |
| run: uv run ruff check | |
| - name: Run pyright | |
| run: uv run pyright | |
| - name: Run pytest | |
| run: uv run pytest --cov harp | |
| - name: Build | |
| run: uv build --all-packages | |
| # ---- Release build ---- | |
| build-release: | |
| runs-on: ubuntu-latest | |
| name: Build release distributions | |
| needs: tests | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v8.3.2 | |
| with: | |
| enable-cache: true | |
| - name: Build | |
| env: | |
| SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.release.tag_name }} | |
| run: uv build --all-packages | |
| - name: Verify setuptools-scm applied the release tag | |
| shell: bash | |
| run: | | |
| ls -1 dist/ | |
| if ls dist/*-0.0.0.tar.gz >/dev/null 2>&1; then | |
| echo "::error::Built version 0.0.0, so setuptools-scm did not apply the tag. Check that every pyproject.toml still declares a tool.setuptools_scm table." | |
| exit 1 | |
| fi | |
| - name: Remove internal-only packages from dist | |
| shell: bash | |
| run: rm -f dist/harp_benchmarks-* | |
| - name: Upload wheels as artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist | |
| path: dist/ | |
| # ---- Publish to PyPI ---- | |
| publish-to-pypi: | |
| runs-on: ubuntu-latest | |
| name: Publish to PyPI | |
| needs: build-release | |
| environment: pypi | |
| permissions: | |
| # uv publish exchanges this token with PyPI trusted publishing. | |
| id-token: write | |
| # action-gh-release attaches the distributions to the release. | |
| contents: write | |
| steps: | |
| - name: Download wheels artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - uses: astral-sh/setup-uv@v8.3.2 | |
| with: | |
| enable-cache: true | |
| - name: Publish to PyPI | |
| run: uv publish | |
| - name: Upload wheels to GitHub release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: dist/* | |
| # ---- Build docs ---- | |
| build-docs: | |
| name: Build documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.3.2 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --group docs | |
| - name: Build documentation | |
| run: uv run mkdocs build | |
| - name: Collect documentation website artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: site/ | |
| # ---- Publish docs ---- | |
| publish-docs: | |
| name: Publish documentation to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: [build-docs, publish-to-pypi] | |
| permissions: | |
| # Both required by actions/deploy-pages. | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: documentation-website | |
| url: ${{ steps.publish.outputs.page_url }} | |
| if: | | |
| !cancelled() && !failure() && needs.build-docs.result == 'success' | |
| && ( | |
| (github.event_name == 'release' && !github.event.release.prerelease) | |
| || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish-docs-website == 'true') | |
| || (github.event_name == 'push' && vars.CONTINUOUS_DOCUMENTATION) | |
| ) | |
| steps: | |
| - name: Publish to GitHub Pages | |
| id: publish | |
| uses: actions/deploy-pages@v5 |