-
Notifications
You must be signed in to change notification settings - Fork 118
95 lines (75 loc) · 2.3 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Tests
on:
push:
branches:
- master
schedule:
- cron: '0 18 * * *' # Run daily at 18:00 UTC
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ ! contains(github.ref, github.event.repository.default_branch) }}
jobs:
linting:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'pytest-dev/pytest-selenium')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tests
run: tox -e linting
test:
name: ubuntu-latest - ${{ matrix.tox-env }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tox-env: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.10", "devel"]
steps:
- uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.tox-env == 'devel' && 3.12 || matrix.tox-env }} # default is for devel
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Start browsers
run: docker/start
- name: Cache tox environments
uses: actions/cache@v4
with:
path: .tox
key: ubuntu-latest-tox-${{ matrix.tox-env }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}
restore-keys: |
ubuntu-latest-tox-${{ matrix.tox-env }}-
- name: Test
run: tox -e ${{ matrix.tox-env }}
- name: Archive report.html
if: failure()
uses: actions/upload-artifact@v4
with:
name: report.html-${{ matrix.tox-env }}.zip
path: .tox/${{ matrix.tox-env }}/log/report.html
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tests
run: tox -e docs