|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: [ main ] |
| 7 | + tags: |
| 8 | + workflow_dispatch: |
| 9 | + schedule: |
| 10 | + # Monthly cron |
| 11 | + - cron: '0 8 1 * *' |
| 12 | + |
| 13 | +jobs: |
| 14 | + tests: |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + fail-fast: true |
| 18 | + matrix: |
| 19 | + include: |
| 20 | + - name: Code style checks |
| 21 | + os: ubuntu-latest |
| 22 | + python-version: 3.x |
| 23 | + toxenv: codestyle |
| 24 | + |
| 25 | + # Linux - test different Sphinx versions |
| 26 | + - os: ubuntu-latest |
| 27 | + python-version: 3.7 |
| 28 | + toxenv: py37-test-sphinx24 |
| 29 | + - os: ubuntu-latest |
| 30 | + python-version: 3.8 |
| 31 | + toxenv: py38-test-sphinx35 |
| 32 | + - os: ubuntu-latest |
| 33 | + python-version: 3.8 |
| 34 | + toxenv: py38-test-sphinx40 |
| 35 | + - os: ubuntu-latest |
| 36 | + python-version: 3.9 |
| 37 | + toxenv: py39-test-sphinx41 |
| 38 | + - os: ubuntu-latest |
| 39 | + python-version: 3.9 |
| 40 | + toxenv: py39-test-sphinx42 |
| 41 | + - os: ubuntu-latest |
| 42 | + python-version: '3.10' |
| 43 | + toxenv: py310-test-sphinx43-cov-clocale |
| 44 | + - os: ubuntu-latest |
| 45 | + python-version: '3.10' |
| 46 | + toxenv: py310-test-sphinxdev |
| 47 | + |
| 48 | + # MacOS X - just the oldest, stable, and dev |
| 49 | + - os: macos-latest |
| 50 | + python-version: 3.7 |
| 51 | + toxenv: py37-test-sphinx24 |
| 52 | + - os: macos-latest |
| 53 | + python-version: 3.8 |
| 54 | + toxenv: py38-test-sphinx43-clocale |
| 55 | + - os: macos-latest |
| 56 | + python-version: 3.9 |
| 57 | + toxenv: py39-test-sphinxdev |
| 58 | + |
| 59 | + # Windows - just the oldest, stable, and dev |
| 60 | + - os: windows-latest |
| 61 | + python-version: 3.7 |
| 62 | + toxenv: py37-test-sphinx24 |
| 63 | + - os: windows-latest |
| 64 | + python-version: 3.8 |
| 65 | + toxenv: py38-test-sphinx43-clocale |
| 66 | + - os: windows-latest |
| 67 | + python-version: 3.9 |
| 68 | + toxenv: py39-test-sphinxdev |
| 69 | + |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v2 |
| 72 | + with: |
| 73 | + fetch-depth: 0 |
| 74 | + - name: Set up Python ${{ matrix.python-version }} |
| 75 | + uses: actions/setup-python@v2 |
| 76 | + with: |
| 77 | + python-version: ${{ matrix.python-version }} |
| 78 | + - name: Install graphviz on Linux |
| 79 | + if: startsWith(matrix.os, 'ubuntu') |
| 80 | + run: | |
| 81 | + sudo apt-get update |
| 82 | + sudo apt-get install graphviz |
| 83 | + - name: Install graphviz on OSX |
| 84 | + if: startsWith(matrix.os, 'macos') |
| 85 | + run: | |
| 86 | + brew update |
| 87 | + brew install graphviz |
| 88 | + - name: Install graphviz on Windows |
| 89 | + if: startsWith(matrix.os, 'windows') |
| 90 | + run: choco install graphviz |
| 91 | + - name: Install tox |
| 92 | + run: python -m pip install tox |
| 93 | + - name: Install codecov |
| 94 | + if: ${{ contains(matrix.toxenv,'-cov') }} |
| 95 | + run: python -m pip install codecov |
| 96 | + - name: Run tox |
| 97 | + run: tox ${{ matrix.toxargs }} -v -e ${{ matrix.toxenv }} |
| 98 | + - name: Upload coverage to codecov |
| 99 | + if: ${{ contains(matrix.toxenv,'-cov') }} |
| 100 | + uses: codecov/codecov-action@v2 |
| 101 | + with: |
| 102 | + file: ./coverage.xml |
0 commit comments