|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + Windows: |
| 11 | + name: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})' |
| 12 | + timeout-minutes: 20 |
| 13 | + runs-on: 'windows-latest' |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + python: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.8-nightly', 'pypy-3.9-nightly'] |
| 18 | + arch: ['x86', 'x64'] |
| 19 | + exclude: |
| 20 | + - python: 'pypy-3.8-nightly' |
| 21 | + arch: 'x86' |
| 22 | + - python: 'pypy-3.9-nightly' |
| 23 | + arch: 'x86' |
| 24 | + continue-on-error: >- |
| 25 | + ${{ |
| 26 | + ( |
| 27 | + endsWith(matrix.python, '-dev') |
| 28 | + || endsWith(matrix.python, '-nightly') |
| 29 | + ) |
| 30 | + && true |
| 31 | + || false |
| 32 | + }} |
| 33 | + steps: |
| 34 | + - name: Checkout |
| 35 | + uses: actions/checkout@v3 |
| 36 | + - name: Setup python |
| 37 | + uses: actions/setup-python@v4 |
| 38 | + with: |
| 39 | + # This allows the matrix to specify just the major.minor version while still |
| 40 | + # expanding it to get the latest patch version including alpha releases. |
| 41 | + # This avoids the need to update for each new alpha, beta, release candidate, |
| 42 | + # and then finally an actual release version. actions/setup-python doesn't |
| 43 | + # support this for PyPy presently so we get no help there. |
| 44 | + # |
| 45 | + # CPython -> 3.9.0-alpha - 3.9.X |
| 46 | + # PyPy -> pypy-3.7 |
| 47 | + python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }} |
| 48 | + architecture: '${{ matrix.arch }}' |
| 49 | + cache: pip |
| 50 | + cache-dependency-path: test-requirements.txt |
| 51 | + - name: Run tests |
| 52 | + run: ./ci.sh |
| 53 | + shell: bash |
| 54 | + env: |
| 55 | + # Should match 'name:' up above |
| 56 | + JOB_NAME: 'Windows (${{ matrix.python }}, ${{ matrix.arch }})' |
| 57 | + |
| 58 | + Linux: |
| 59 | + name: 'Linux (${{ matrix.python }}${{ matrix.extra_name }})' |
| 60 | + timeout-minutes: 10 |
| 61 | + runs-on: 'ubuntu-latest' |
| 62 | + strategy: |
| 63 | + fail-fast: false |
| 64 | + matrix: |
| 65 | + python: ['pypy-3.7', 'pypy-3.8', 'pypy-3.9', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev', 'pypy-3.8-nightly', 'pypy-3.9-nightly'] |
| 66 | + check_lint: ['0'] |
| 67 | + extra_name: [''] |
| 68 | + include: |
| 69 | + - python: '3.8' |
| 70 | + check_lint: '1' |
| 71 | + extra_name: ', check lint' |
| 72 | + continue-on-error: >- |
| 73 | + ${{ |
| 74 | + ( |
| 75 | + matrix.check_formatting == '1' |
| 76 | + || endsWith(matrix.python, '-dev') |
| 77 | + || endsWith(matrix.python, '-nightly') |
| 78 | + ) |
| 79 | + && true |
| 80 | + || false |
| 81 | + }} |
| 82 | + steps: |
| 83 | + - name: Checkout |
| 84 | + uses: actions/checkout@v3 |
| 85 | + - name: Setup python |
| 86 | + uses: actions/setup-python@v4 |
| 87 | + if: "!endsWith(matrix.python, '-dev')" |
| 88 | + with: |
| 89 | + python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }} |
| 90 | + cache: pip |
| 91 | + cache-dependency-path: test-requirements.txt |
| 92 | + - name: Setup python (dev) |
| 93 | + uses: deadsnakes/action@v2.0.2 |
| 94 | + if: endsWith(matrix.python, '-dev') |
| 95 | + with: |
| 96 | + python-version: '${{ matrix.python }}' |
| 97 | + - name: Run tests |
| 98 | + run: ./ci.sh |
| 99 | + env: |
| 100 | + CHECK_LINT: '${{ matrix.check_lint }}' |
| 101 | + # Should match 'name:' up above |
| 102 | + JOB_NAME: 'Linux (${{ matrix.python }}${{ matrix.extra_name }})' |
| 103 | + |
| 104 | + macOS: |
| 105 | + name: 'macOS (${{ matrix.python }})' |
| 106 | + timeout-minutes: 10 |
| 107 | + runs-on: 'macos-latest' |
| 108 | + strategy: |
| 109 | + fail-fast: false |
| 110 | + matrix: |
| 111 | + python: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.8-nightly', 'pypy-3.9-nightly'] |
| 112 | + continue-on-error: >- |
| 113 | + ${{ |
| 114 | + ( |
| 115 | + endsWith(matrix.python, '-dev') |
| 116 | + || endsWith(matrix.python, '-nightly') |
| 117 | + ) |
| 118 | + && true |
| 119 | + || false |
| 120 | + }} |
| 121 | + steps: |
| 122 | + - name: Checkout |
| 123 | + uses: actions/checkout@v3 |
| 124 | + - name: Setup python |
| 125 | + uses: actions/setup-python@v4 |
| 126 | + with: |
| 127 | + python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }} |
| 128 | + cache: pip |
| 129 | + cache-dependency-path: test-requirements.txt |
| 130 | + - name: Run tests |
| 131 | + run: ./ci.sh |
| 132 | + env: |
| 133 | + # Should match 'name:' up above |
| 134 | + JOB_NAME: 'macOS (${{ matrix.python }})' |
0 commit comments