Minor tweaks (#255) #619
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: Python checks | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| schedule: | |
| - cron: '0 7 * * 1' | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| name: Lint Python Code Base with Ruff | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b | |
| with: | |
| version: "latest" | |
| args: "check" | |
| src: "./revrt" | |
| - uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b | |
| with: | |
| version: "latest" | |
| args: "format --check" | |
| src: "./revrt" | |
| locked-tests: | |
| needs: lint | |
| name: Pixi-Locked Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 8 | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5 | |
| with: | |
| pixi-version: v0.63.2 | |
| locked: true | |
| cache: true | |
| cache-write: false | |
| environments: dev | |
| - run: | | |
| pixi reinstall -e dev --locked NLR-reVRt | |
| unit-tests: | |
| needs: lint | |
| name: Python Unit Tests (Pixi) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 8 | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5 | |
| with: | |
| pixi-version: v0.63.2 | |
| locked: true | |
| cache: true | |
| cache-write: ${{ github.ref == 'refs/heads/main' }} | |
| environments: dev | |
| - run: | | |
| pixi reinstall -e dev NLR-reVRt | |
| pixi run -e dev tests-u | |
| integration-tests: | |
| needs: lint | |
| name: Python Integration Tests (Pixi) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 8 | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5 | |
| with: | |
| pixi-version: v0.63.2 | |
| locked: true | |
| cache: true | |
| cache-write: ${{ github.ref == 'refs/heads/main' }} | |
| environments: dev | |
| - run: | | |
| pixi reinstall -e dev NLR-reVRt | |
| pixi run -e dev tests-i | |
| tox-tests: | |
| needs: lint | |
| name: Python tests (Tox) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 8 | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ['3.13', '3.12', '3.11'] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install tox tox-gh-actions>=2.0 | |
| - name: Load tox cache | |
| uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae | |
| with: | |
| path: .tox/ | |
| key: ${{ runner.os }}-${{ matrix.python-version }}-tox-v1-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.python-version }}-tox-v1- | |
| - name: Test with tox | |
| run: tox -e ${{ matrix.python-version == '3.11' && 'msv' || 'latest' }} | |
| env: | |
| PYTHONDEVMODE: 1 | |
| REVRT_TOX_TEST_PATH: ${{ github.ref == 'refs/heads/main' && 'tests' || 'tests/python/unit' }} | |
| - name: Save tox cache only on main | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae | |
| with: | |
| path: .tox/ | |
| key: ${{ runner.os }}-${{ matrix.python-version }}-tox-v1-${{ hashFiles('**/pyproject.toml') }} |