|
| 1 | +name: Numba-cache-lock |
| 2 | + |
| 3 | +on: |
| 4 | + # Trigger the workflow on push or pull request, |
| 5 | + # but only for the main branch |
| 6 | + pull_request: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + |
| 10 | +# kill any previous running job on a new commit |
| 11 | +concurrency: |
| 12 | + group: build-and-test-cache-lock-${{ github.head_ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + lint: |
| 17 | + if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-tests') }} |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + strategy: |
| 20 | + fail-fast: true |
| 21 | + matrix: |
| 22 | + os: [ubuntu-latest] |
| 23 | + python-version: ['3.12'] |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Checkout code |
| 27 | + uses: actions/checkout@v2 |
| 28 | + |
| 29 | + - name: Set up Python |
| 30 | + uses: actions/setup-python@v2 |
| 31 | + with: |
| 32 | + python-version: ${{ matrix.python-version }} |
| 33 | + |
| 34 | + - name: Install Poetry |
| 35 | + uses: snok/install-poetry@v1 |
| 36 | + |
| 37 | + - name: Install dependencies |
| 38 | + run: poetry install --no-interaction |
| 39 | + |
| 40 | + - name: Run black |
| 41 | + run: poetry run black --check . |
| 42 | + |
| 43 | + - name: Run ruff |
| 44 | + run: poetry run ruff check . |
| 45 | + |
| 46 | + - name: Run mypy |
| 47 | + run: poetry run mypy . |
| 48 | + |
| 49 | + test: |
| 50 | + name: ${{ matrix.os }} - Python v${{ matrix.python-version }} |
| 51 | + runs-on: ${{ matrix.os }} |
| 52 | + timeout-minutes: 10 |
| 53 | + strategy: |
| 54 | + fail-fast: false |
| 55 | + matrix: |
| 56 | + os: [ubuntu-latest] |
| 57 | + python-version: ['3.11', '3.12'] |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: Checkout code |
| 61 | + uses: actions/checkout@v2 |
| 62 | + |
| 63 | + - name: Set up Python ${{ matrix.python-version }} |
| 64 | + uses: actions/setup-python@v2 |
| 65 | + with: |
| 66 | + python-version: ${{ matrix.python-version }} |
| 67 | + |
| 68 | + - name: Install Poetry |
| 69 | + uses: snok/install-poetry@v1 |
| 70 | + |
| 71 | + - name: Install dependencies |
| 72 | + run: poetry install --no-interaction |
| 73 | + |
| 74 | + - name: Run tests |
| 75 | + shell: bash -l {0} |
| 76 | + run: | |
| 77 | + poetry run python -m unittest discover -s tests |
0 commit comments