Test Python package #552
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: Test Python package | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| merge_group: | |
| env: | |
| UV_SYSTEM_PYTHON: 1 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/requirements*.txt | |
| **/pyproject.toml | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.12 | |
| - name: Install dependencies | |
| run: uv pip install nox[uv] | |
| - name: Test with pytest | |
| run: nox -db uv -s tests | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }} | |
| lammps: | |
| name: Test LAMMPS | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/requirements*.txt | |
| **/pyproject.toml | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.12 | |
| - name: Install dependencies | |
| run: uv pip install nox[uv] | |
| - name: Test with LAMMPS | |
| run: nox -db uv -s lammps | |
| pass: | |
| name: Pass testing Python | |
| needs: [build, lammps] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |