|
1 |
| -name: test |
| 1 | +name: Tests |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | branches:
|
6 | 6 | - master
|
7 |
| - tags-ignore: |
8 |
| - - v* |
| 7 | + |
| 8 | + schedule: |
| 9 | + - cron: '0 18 * * *' # Run daily at 14:00 UTC |
| 10 | + |
9 | 11 | pull_request:
|
10 |
| - workflow_call: |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 15 | + cancel-in-progress: ${{ ! contains(github.ref, github.event.repository.default_branch) }} |
11 | 16 |
|
12 | 17 | env:
|
13 | 18 | PYTEST_ADDOPTS: "-m 'not (edge or safari)'"
|
14 | 19 |
|
15 | 20 | jobs:
|
| 21 | + linting: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v3 |
| 25 | + |
| 26 | + - name: Set up Python |
| 27 | + uses: actions/setup-python@v4 |
| 28 | + with: |
| 29 | + python-version: "3.10" |
| 30 | + |
| 31 | + - name: Install dependencies |
| 32 | + run: | |
| 33 | + python -m pip install --upgrade pip |
| 34 | + pip install tox |
| 35 | +
|
| 36 | + - name: Run tests |
| 37 | + run: tox -e linting |
| 38 | + |
16 | 39 | test:
|
| 40 | + name: ${{ matrix.os }} - ${{ matrix.python-version }} |
17 | 41 | runs-on: ${{ matrix.os }}
|
18 | 42 | strategy:
|
19 |
| - fail-fast: false |
| 43 | + fail-fast: true |
20 | 44 | matrix:
|
21 |
| - python: ["3.7", "3.8", "3.9", "3.10", "pypy-3.8"] |
22 | 45 | os: [ubuntu-latest, windows-latest]
|
| 46 | + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] |
23 | 47 | include:
|
24 |
| - - python: "3.7" |
25 |
| - tox_env: "py37" |
26 |
| - - python: "3.8" |
27 |
| - tox_env: "py38" |
28 |
| - - python: "3.9" |
29 |
| - tox_env: "py39" |
30 |
| - - python: "3.10" |
31 |
| - tox_env: "py310" |
32 |
| - - python: "pypy-3.8" |
33 |
| - tox_env: "pypy3" |
| 48 | + - os: ubuntu-latest |
| 49 | + python-version: pypy3.9 |
| 50 | + tox-env: py3.9 |
| 51 | + - os: windows-latest |
| 52 | + python-version: pypy3.9 |
| 53 | + tox-env: py3.9 |
| 54 | + |
| 55 | +# TODO(jim) Deactivate devel tests pending troubleshooting |
| 56 | +# - os: ubuntu-latest |
| 57 | +# python-version: 3.12-dev |
| 58 | +# tox-env: devel |
| 59 | +# - os: windows-latest |
| 60 | +# python-version: 3.12-dev |
| 61 | +# tox-env: devel |
| 62 | + |
34 | 63 | steps:
|
35 |
| - - uses: actions/checkout@v3 |
36 |
| - |
37 |
| - - name: Set up Python |
38 |
| - uses: actions/setup-python@v3 |
39 |
| - with: |
40 |
| - python-version: ${{ matrix.python }} |
41 |
| - |
42 |
| - - name: Install tox |
43 |
| - run: | |
44 |
| - python -m pip install --upgrade pip |
45 |
| - pip install tox |
46 |
| -
|
47 |
| - - name: Setup Firefox |
48 |
| - if: matrix.os == 'ubuntu-latest' |
49 |
| - uses: browser-actions/setup-firefox@latest |
50 |
| - with: |
51 |
| - firefox-version: latest |
52 |
| - |
53 |
| - - name: Setup Geckodriver |
54 |
| - if: matrix.os == 'ubuntu-latest' |
55 |
| - uses: browser-actions/setup-geckodriver@latest |
56 |
| - |
57 |
| - - name: Setup Chrome |
58 |
| - uses: browser-actions/setup-chrome@latest |
59 |
| - with: |
60 |
| - chrome-version: stable |
61 |
| - |
62 |
| - - name: Setup Chromedriver |
63 |
| - uses: nanasess/setup-chromedriver@master |
64 |
| - |
65 |
| - - name: Cache tox environments |
66 |
| - uses: actions/cache@v3 |
67 |
| - with: |
68 |
| - path: .tox |
69 |
| - key: tox-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }} |
70 |
| - |
71 |
| - - name: Test |
72 |
| - if: matrix.os == 'ubuntu-latest' |
73 |
| - run: tox -e ${{ matrix.tox_env }} |
74 |
| - |
75 |
| - - name: Test (skip firefox on windows) |
76 |
| - if: matrix.os == 'windows-latest' |
77 |
| - env: |
78 |
| - PYTEST_ADDOPTS: "-m 'not (edge or safari or firefox)'" |
79 |
| - run: tox -e ${{ matrix.tox_env }} |
| 64 | + - uses: actions/checkout@v3 |
| 65 | + |
| 66 | + - name: Set up python |
| 67 | + uses: actions/setup-python@v4 |
| 68 | + with: |
| 69 | + python-version: ${{ matrix.python-version }} |
| 70 | + |
| 71 | + - name: Install tox |
| 72 | + run: | |
| 73 | + python -m pip install --upgrade pip |
| 74 | + pip install tox |
| 75 | +
|
| 76 | + - name: Setup Firefox |
| 77 | + if: matrix.os == 'ubuntu-latest' |
| 78 | + uses: browser-actions/setup-firefox@latest |
| 79 | + with: |
| 80 | + firefox-version: latest |
| 81 | + |
| 82 | + - name: Setup Geckodriver |
| 83 | + if: matrix.os == 'ubuntu-latest' |
| 84 | + uses: browser-actions/setup-geckodriver@latest |
| 85 | + |
| 86 | + - name: Setup Chrome |
| 87 | + uses: browser-actions/setup-chrome@latest |
| 88 | + with: |
| 89 | + chrome-version: stable |
| 90 | + |
| 91 | + - name: Setup Chromedriver |
| 92 | + uses: nanasess/setup-chromedriver@master |
| 93 | + |
| 94 | + - name: Cache tox environments |
| 95 | + uses: actions/cache@v3 |
| 96 | + with: |
| 97 | + path: .tox |
| 98 | + key: tox-ubuntu-latest-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'tox.ini') }} |
| 99 | + restore-keys: | |
| 100 | + tox-ubuntu-latest-${{ matrix.python-version }}- |
| 101 | +
|
| 102 | + - name: Set tox variable |
| 103 | + shell: bash |
| 104 | + run: | |
| 105 | + echo "python-version: ${{ matrix.python-version }}" |
| 106 | + echo "tox-env: ${{ matrix.tox-env }}" |
| 107 | + if [[ -n "${{ matrix.tox-env }}" ]]; then |
| 108 | + echo "tox=${{ matrix.tox-env }}" >> "$GITHUB_ENV" |
| 109 | + else |
| 110 | + echo "tox=py${{ matrix.python-version }}" >> "$GITHUB_ENV" |
| 111 | + fi |
| 112 | +
|
| 113 | + - name: Test |
| 114 | + if: matrix.os == 'ubuntu-latest' |
| 115 | + run: tox -e "${{ env.tox }}" |
| 116 | + |
| 117 | + - name: Test (skip firefox on windows) |
| 118 | + if: matrix.os == 'windows-latest' |
| 119 | + env: |
| 120 | + PYTEST_ADDOPTS: "-m 'not (edge or safari or firefox)'" |
| 121 | + run: tox -e "${{ env.tox }}" |
| 122 | + |
| 123 | + - name: Archive report.html |
| 124 | + if: failure() |
| 125 | + uses: actions/upload-artifact@v1 |
| 126 | + with: |
| 127 | + name: report.html.${{ matrix.os }}-${{ env.tox }}.zip |
| 128 | + path: .tox/${{ env.tox }}/log/report.html |
80 | 129 |
|
81 | 130 | docs:
|
82 | 131 | runs-on: ubuntu-latest
|
83 | 132 | steps:
|
84 |
| - - uses: actions/checkout@v3 |
| 133 | + - uses: actions/checkout@v3 |
85 | 134 |
|
86 |
| - - name: Set up Python |
87 |
| - uses: actions/setup-python@v3 |
88 |
| - with: |
89 |
| - python-version: 3.9 |
| 135 | + - name: Set up Python |
| 136 | + uses: actions/setup-python@v4 |
| 137 | + with: |
| 138 | + python-version: "3.10" |
90 | 139 |
|
91 |
| - - name: Install dependencies |
92 |
| - run: | |
93 |
| - python -m pip install --upgrade pip |
94 |
| - pip install tox |
| 140 | + - name: Install dependencies |
| 141 | + run: | |
| 142 | + python -m pip install --upgrade pip |
| 143 | + pip install tox |
95 | 144 |
|
96 |
| - - name: Run tests |
97 |
| - run: "tox -e docs" |
| 145 | + - name: Run tests |
| 146 | + run: tox -e docs |
0 commit comments