tests #142
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: tests | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| schedule: | |
| - cron: "17 3 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| python-version: | |
| description: "Python version for the full integration job" | |
| required: false | |
| default: "3.12" | |
| type: string | |
| pytest-args: | |
| description: "pytest arguments for the full integration job" | |
| required: false | |
| default: "-q -o addopts=" | |
| type: string | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| fast-tests: | |
| name: fast tests (${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| env: | |
| PYTHONUTF8: "1" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| cache-dependency-path: | | |
| pyproject.toml | |
| - name: Install package + test deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" | |
| python -m pip install pyscf | |
| - name: Debug environment | |
| run: | | |
| python --version | |
| python -m pip --version | |
| python -m pip freeze | sed -n '1,200p' | |
| - name: Run fast tests | |
| run: | | |
| pytest -q | |
| full-tests: | |
| name: full integration tests | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| env: | |
| PYTHONUTF8: "1" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ inputs['python-version'] || '3.12' }} | |
| cache: "pip" | |
| cache-dependency-path: | | |
| pyproject.toml | |
| - name: Install package + test deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" | |
| python -m pip install pyscf | |
| - name: Debug environment | |
| run: | | |
| python --version | |
| python -m pip --version | |
| python -m pip freeze | sed -n '1,200p' | |
| - name: Run full test suite | |
| run: | | |
| pytest ${{ inputs['pytest-args'] || '-q -o addopts=' }} |