|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +env: |
| 15 | + # Many color libraries just need this to be set to any value, but at least |
| 16 | + # one distinguishes color depth, where "3" -> "256-bit color". |
| 17 | + FORCE_COLOR: 3 |
| 18 | + # Jupyter is migrating its paths to use standard platformdirs |
| 19 | + # given by the platformdirs library. To remove this warning and |
| 20 | + # see the appropriate new directories, set the environment variable |
| 21 | + # `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`. |
| 22 | + # The use of platformdirs will be the default in `jupyter_core` v6 |
| 23 | + JUPYTER_PLATFORM_DIRS: 1 |
| 24 | + |
| 25 | +jobs: |
| 26 | + pre-commit: |
| 27 | + name: Format |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
| 33 | + - uses: actions/setup-python@v5 |
| 34 | + with: |
| 35 | + python-version: "3.x" |
| 36 | + - uses: pre-commit/[email protected] |
| 37 | + with: |
| 38 | + extra_args: --hook-stage manual --all-files |
| 39 | + |
| 40 | + checks: |
| 41 | + name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} |
| 42 | + runs-on: ${{ matrix.runs-on }} |
| 43 | + needs: [pre-commit] |
| 44 | + strategy: |
| 45 | + fail-fast: false |
| 46 | + matrix: |
| 47 | + python-version: ["3.10", "3.11", "3.12", "3.13"] |
| 48 | + runs-on: [ubuntu-latest] |
| 49 | + |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v4 |
| 52 | + with: |
| 53 | + fetch-depth: 0 |
| 54 | + |
| 55 | + - uses: actions/setup-python@v5 |
| 56 | + with: |
| 57 | + python-version: ${{ matrix.python-version }} |
| 58 | + allow-prereleases: true |
| 59 | + |
| 60 | + - name: Install package |
| 61 | + run: python -m pip install uv && uv pip install .[dev] --system |
| 62 | + |
| 63 | + - name: Test package |
| 64 | + run: >- |
| 65 | + python -m pytest -ra --cov --cov-report=xml --cov-report=term |
| 66 | + --durations=20 --junitxml=junit.xml -o junit_family=legacy --ignore=submit |
| 67 | +
|
| 68 | + - name: Upload coverage reports to Codecov |
| 69 | + uses: codecov/codecov-action@v5 |
| 70 | + with: |
| 71 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 72 | + slug: AlecThomson/arrakis |
| 73 | + |
| 74 | + - name: Upload test results to Codecov |
| 75 | + if: ${{ !cancelled() }} |
| 76 | + uses: codecov/test-results-action@v1 |
| 77 | + with: |
| 78 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments