Add dataset reader to harp-data (#15) #34
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: | |
| 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/* | |
| # ---- Docs ---- | |
| build-docs: | |
| name: Build and deploy documentation to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: build-release | |
| if: github.event_name == 'release' && !github.event.release.prerelease | |
| 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: Configure Git user | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Build & Deploy docs | |
| run: uv run mkdocs gh-deploy --force |