-
Notifications
You must be signed in to change notification settings - Fork 25
127 lines (116 loc) · 4.56 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Test
# On all pushes to PRs or pushes to specific branches. Not on ALL pushes in general because it will
# double if pushing to a PR.
on:
pull_request:
push:
branches:
- 'master'
- 'dev'
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Start Linux jobs last since they are fastest to start and complete, and start 3.12 first,
# since it pairs wiht macOS+Windows jobs, and 3.5 and 3.6 last since they only run tests and
# don't use venv. 3.4 is not supported on GitHub anymore and 3.5 and 3.6 for x64 isn't
# produced for ubuntu 22.04.
python-version: ['3.12', '3.11', '3.10', 3.9, 3.8, 3.7, 3.6, 3.5]
os: [windows-latest, macos-latest, ubuntu-latest]
# Choose test script depending on OS.
include:
- os: ubuntu-latest
test_script_name: ./misc/actions/test.sh
- os: macos-latest
test_script_name: ./misc/actions/test.sh
- os: windows-latest
test_script_name: ./misc/actions/test.ps1
exclude:
# Only test on macOS and Windows with Python 3.12.
# But do test 3.5 and 3.6 on macOS because they aren't compiled for x64 on Ubuntu 22.04.
# - os: macos-latest
# python-version: 3.5
# - os: macos-latest
# python-version: 3.6
- os: macos-latest
python-version: 3.7
- os: macos-latest
python-version: 3.8
- os: macos-latest
python-version: 3.9
- os: macos-latest
python-version: '3.10'
- os: macos-latest
python-version: '3.11'
- os: windows-latest
python-version: 3.5
- os: windows-latest
python-version: 3.6
- os: windows-latest
python-version: 3.7
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9
- os: windows-latest
python-version: '3.10'
- os: windows-latest
python-version: '3.11'
# Ignore 3.5 and 3.6 on Linux because it isn't compiled for x64 on Ubuntu 22.04.
# Test on macOS instead.
- os: ubuntu-latest
python-version: 3.5
- os: ubuntu-latest
python-version: 3.6
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
with:
python-version: ${{ matrix.python-version }}
# The caches need to have the python version included since the
# "misc/.coverage-requirements.txt" does not have version-pinning.
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
if: startsWith(matrix.os, 'ubuntu-latest')
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/.*-requirements.txt') }}
restore-keys: |
${{ matrix.os }}-pip-${{ matrix.python-version }}-
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
if: startsWith(matrix.os, 'macos-latest')
with:
path: ~/Library/Caches/pip
key: ${{ matrix.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/.*-requirements.txt') }}
restore-keys: |
${{ matrix.os }}-pip-${{ matrix.python-version }}-
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
if: startsWith(matrix.os, 'windows-latest')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ matrix.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/.*-requirements.txt') }}
restore-keys: |
${{ matrix.os }}-pip-${{ matrix.python-version }}-
- name: Test and coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.os }}-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: ${{ matrix.test_script_name }}
# When all parallel tests are done and uploaded, the coveralls session can be signalled as
# finished.
finish:
permissions:
checks: write # for coverallsapp/github-action to create new checks
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true