|
| 1 | +name: Check |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + test: |
| 8 | + name: Test |
| 9 | + runs-on: ubuntu-latest |
| 10 | + |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + python-version: ["3.6", "3.7", "3.8", "3.9"] |
| 14 | + django-version: ["2.2", "3.0", "3.1", "3.2", "4.0"] |
| 15 | + exclude: |
| 16 | + # Python 3.6 is not supported beyond Django 3.2 |
| 17 | + - python-version: "3.6" |
| 18 | + django-version: "4.0" |
| 19 | + # Python 3.7 is not supported beyond Django 3.2 |
| 20 | + - python-version: "3.7" |
| 21 | + django-version: "4.0" |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Checkout |
| 25 | + uses: actions/checkout@v3 |
| 26 | + |
| 27 | + - name: Set up Python ${{ matrix.python-version }} |
| 28 | + uses: actions/setup-python@v4 |
| 29 | + with: |
| 30 | + python-version: ${{ matrix.python-version }} |
| 31 | + cache: poetry |
| 32 | + |
| 33 | + - name: Set up Poetry |
| 34 | + uses: abatilo/actions-poetry@v2 |
| 35 | + with: |
| 36 | + # Need to use version < 1.2.0 in order to support Python 3.6 |
| 37 | + poetry-version: 1.1.15 |
| 38 | + |
| 39 | + - name: Set up dependencies |
| 40 | + run: poetry install |
| 41 | + |
| 42 | + - name: Run tests |
| 43 | + run: poetry run ./runtests |
| 44 | + |
| 45 | + lint: |
| 46 | + name: Lint |
| 47 | + runs-on: ubuntu-latest |
| 48 | + |
| 49 | + strategy: |
| 50 | + matrix: |
| 51 | + python-version: ["3.6", "3.7", "3.8", "3.9"] |
| 52 | + django-version: ["2.2", "3.0", "3.1", "3.2", "4.0"] |
| 53 | + exclude: |
| 54 | + # Python 3.6 is not supported beyond Django 3.2 |
| 55 | + - python-version: "3.6" |
| 56 | + django-version: "4.0" |
| 57 | + # Python 3.7 is not supported beyond Django 3.2 |
| 58 | + - python-version: "3.7" |
| 59 | + django-version: "4.0" |
| 60 | + |
| 61 | + steps: |
| 62 | + - name: Checkout |
| 63 | + uses: actions/checkout@v3 |
| 64 | + |
| 65 | + - name: Set up Python ${{ matrix.python-version }} |
| 66 | + uses: actions/setup-python@v4 |
| 67 | + with: |
| 68 | + python-version: ${{ matrix.python-version }} |
| 69 | + cache: poetry |
| 70 | + |
| 71 | + - name: Set up Poetry |
| 72 | + uses: abatilo/actions-poetry@v2 |
| 73 | + with: |
| 74 | + # Need to use version < 1.2.0 in order to support Python 3.6 |
| 75 | + poetry-version: 1.1.15 |
| 76 | + |
| 77 | + - name: Set up dependencies |
| 78 | + run: poetry install |
| 79 | + |
| 80 | + - name: Run linters |
| 81 | + run: poetry run flake8 --jobs=auto --format=github |
| 82 | + |
| 83 | + type-check: |
| 84 | + name: Type Check |
| 85 | + runs-on: ubuntu-latest |
| 86 | + |
| 87 | + strategy: |
| 88 | + matrix: |
| 89 | + python-version: ["3.6", "3.7", "3.8", "3.9"] |
| 90 | + django-version: ["2.2", "3.0", "3.1", "3.2", "4.0"] |
| 91 | + exclude: |
| 92 | + # Python 3.6 is not supported beyond Django 3.2 |
| 93 | + - python-version: "3.6" |
| 94 | + django-version: "4.0" |
| 95 | + # Python 3.7 is not supported beyond Django 3.2 |
| 96 | + - python-version: "3.7" |
| 97 | + django-version: "4.0" |
| 98 | + |
| 99 | + steps: |
| 100 | + - name: Checkout |
| 101 | + uses: actions/checkout@v3 |
| 102 | + |
| 103 | + - name: Set up Python ${{ matrix.python-version }} |
| 104 | + uses: actions/setup-python@v4 |
| 105 | + with: |
| 106 | + python-version: ${{ matrix.python-version }} |
| 107 | + cache: poetry |
| 108 | + |
| 109 | + - name: Set up Poetry |
| 110 | + uses: abatilo/actions-poetry@v2 |
| 111 | + with: |
| 112 | + # Need to use version < 1.2.0 in order to support Python 3.6 |
| 113 | + poetry-version: 1.1.15 |
| 114 | + |
| 115 | + - name: Set up dependencies |
| 116 | + run: poetry install |
| 117 | + |
| 118 | + - name: Run type checking |
| 119 | + run: poetry run ./script/type-check |
0 commit comments