-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (71 loc) · 2.31 KB
/
tests.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
name: tests
on:
push:
branches: [ main ]
pull_request:
schedule:
- cron: '0 1 * * 0' # run once a week on Sunday
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
# [Python version, tox env]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["3.11", "py311"]
browser:
# - ff # unability to solve `API rate limit exceeded` problems
- chrome
# - edge # Edge version and driver version do not match
state:
- headless
# - head # disabled because it needs xvfb which is not so easy to set up on GHA
runs-on: ubuntu-latest
name: ${{ matrix.config[1] }}-${{ matrix.browser }}-${{ matrix.state }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Install dependencies (firefox)
if: matrix.browser == 'ff'
run: |
sudo apt-get update
sudo apt-get install firefox
- name: Install dependencies (edge)
if: matrix.browser == 'edge'
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
sudo rm microsoft.gpg
sudo apt update
sudo apt install microsoft-edge-stable
- name: Test
run: |
tox -f ${{ matrix.config[1] }}-${{ matrix.browser }}-${{ matrix.state }}
- name: Report to coveralls
run: |
pip install coverage coveralls
coverage combine
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}