pre-commit autoupdate #53
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: Test | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| task: | |
| type: choice | |
| options: [tests, release] | |
| default: tests | |
| description: Only run tests or release a new version to PyPI after tests pass. | |
| jobs: | |
| test: | |
| strategy: | |
| max-parallel: 20 | |
| matrix: | |
| os: [ubuntu-latest] | |
| python-version: ["3.10", "3.11"] | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv with python version. | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install dependencies | |
| run: | | |
| uv pip install dgl==2.4.0 -f https://data.dgl.ai/wheels/torch-2.4/repo.html | |
| uv sync | |
| - name: pytest | |
| run: | | |
| uv run pytest tests --cov=maml | |
| - name: Upload coverage reports to Codecov | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: codecov/codecov-action@v4 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| release: | |
| if: github.event.name == 'release' | |
| needs: test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # For pypi trusted publishing | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv with python version. | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install dependencies | |
| run: | | |
| uv pip install dgl==2.4.0 -f https://data.dgl.ai/wheels/torch-2.4/repo.html | |
| uv sync | |
| - run: | | |
| uv build | |
| - name: Publish to PyPi | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true | |
| verbose: true |