|
1 | 1 | name: Python |
2 | | -on: [push] |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +env: |
| 8 | + LINT_PYTHON_VERSION: 3.11 |
3 | 9 |
|
4 | 10 | jobs: |
5 | | - test: |
| 11 | + lint: |
6 | 12 | runs-on: ubuntu-latest |
7 | | - strategy: |
8 | | - matrix: |
9 | | - python-version: [3.8, 3.9, "3.10", "3.11"] |
10 | 13 |
|
11 | 14 | steps: |
12 | | - - uses: actions/checkout@v2.3.4 |
| 15 | + - uses: actions/checkout@v3 |
13 | 16 | with: |
14 | 17 | fetch-depth: 1 |
15 | 18 |
|
16 | | - - name: Set up Python ${{ matrix.python-version }} |
17 | | - |
| 19 | + - name: Install Poetry |
| 20 | + run: | |
| 21 | + pipx install poetry |
| 22 | + poetry config virtualenvs.path ~/.virtualenvs${{ env.LINT_PYTHON_VERSION }} |
| 23 | +
|
| 24 | + - name: Set up Python ${{ env.LINT_PYTHON_VERSION }} |
| 25 | + uses: actions/setup-python@v3 |
18 | 26 | with: |
19 | | - python-version: ${{ matrix.python-version }} |
| 27 | + python-version: ${{ env.LINT_PYTHON_VERSION }} |
| 28 | + cache: "poetry" |
20 | 29 |
|
21 | | - - name: Install Poetry |
22 | | - |
| 30 | + - name: Install dependencies |
| 31 | + run: | |
| 32 | + poetry install |
| 33 | +
|
| 34 | + - name: ruff check |
| 35 | + run: poetry run ruff check . |
| 36 | + |
| 37 | + - name: mypy check |
| 38 | + run: poetry run mypy django_unicorn |
| 39 | + |
| 40 | + test: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + strategy: |
| 43 | + matrix: |
| 44 | + python-version: ["3.10", "3.11", "3.12"] |
| 45 | + django-version: ["4.1", "4.2", "5.0"] |
| 46 | + |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v3 |
23 | 49 | with: |
24 | | - poetry-version: 1.6.1 |
| 50 | + fetch-depth: 1 |
25 | 51 |
|
26 | | - - name: Set Poetry config |
| 52 | + - name: Install Poetry |
27 | 53 | run: | |
| 54 | + pipx install poetry |
28 | 55 | poetry config virtualenvs.path ~/.virtualenvs${{ matrix.python-version }} |
29 | 56 |
|
| 57 | + - name: Set up Python ${{ matrix.python-version }} |
| 58 | + uses: actions/setup-python@v3 |
| 59 | + with: |
| 60 | + python-version: ${{ matrix.python-version }} |
| 61 | + cache: "poetry" |
| 62 | + |
30 | 63 | - name: Install dependencies |
31 | | - run: poetry install |
| 64 | + run: | |
| 65 | + poetry env use ${{ matrix.python-version }} |
| 66 | + poetry add django==${{ matrix.django-version }} |
| 67 | + poetry install -E minify |
32 | 68 |
|
33 | | - - name: ruff check |
34 | | - run: poetry run ruff . |
| 69 | + - name: Fast tests |
| 70 | + run: poetry run pytest -m 'not slow' |
35 | 71 |
|
36 | | - - name: Run all tests |
37 | | - run: poetry run nox |
| 72 | + - name: Slow tests |
| 73 | + run: poetry run pytest -m 'slow' |
0 commit comments