Skip to content

Commit 16d007f

Browse files
author
avandras
committed
Update Python versions and use matrix to avoid repetition
1 parent f6943a8 commit 16d007f

File tree

1 file changed

+29
-50
lines changed

1 file changed

+29
-50
lines changed

.github/workflows/tests.yaml

Lines changed: 29 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,60 +13,34 @@ env:
1313

1414
jobs:
1515
unit:
16-
runs-on: ${{ matrix.os }}-latest
16+
runs-on: ${{ matrix.os }}
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
os: [ubuntu, windows, macos]
20+
os: [ubuntu-latest, windows-latest, macos-latest]
21+
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12]
22+
exclude:
23+
- os: ubuntu-latest
24+
python-version: 3.7
25+
include:
26+
- os: ubuntu-22.04
27+
python-version: 3.7
2128

2229
steps:
23-
- uses: actions/checkout@v3
24-
25-
- name: Set up Python 3.7
26-
uses: actions/setup-python@v4
27-
with:
28-
python-version: 3.7
29-
- name: Install dependencies
30-
run: python .github/workflows/install_deps.py
31-
- name: Run tests and flake8
32-
run: python .github/workflows/run_tests.py
33-
34-
- name: Set up Python 3.8
35-
uses: actions/setup-python@v4
36-
with:
37-
python-version: 3.8
38-
- name: Install dependencies
39-
run: python .github/workflows/install_deps.py
40-
- name: Run tests and flake8
41-
run: python .github/workflows/run_tests.py
42-
43-
- name: Set up Python 3.9
44-
uses: actions/setup-python@v4
45-
with:
46-
python-version: 3.9
47-
- name: Install dependencies
48-
run: python .github/workflows/install_deps.py
49-
- name: Run tests and flake8
50-
run: python .github/workflows/run_tests.py
30+
- uses: actions/checkout@v4
5131

52-
- name: Set up Python 3.10
53-
uses: actions/setup-python@v4
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v5
5434
with:
55-
python-version: '3.10'
56-
- name: Install dependencies
57-
run: python .github/workflows/install_deps.py
58-
- name: Run tests and flake8
59-
run: python .github/workflows/run_tests.py
60-
61-
- name: Set up Python 3.11
62-
uses: actions/setup-python@v4
63-
with:
64-
python-version: 3.11
35+
python-version: ${{ matrix.python-version }}
6536
- name: Install dependencies
6637
run: python .github/workflows/install_deps.py
6738
- name: Run tests and flake8
6839
run: python .github/workflows/run_tests.py
6940

41+
post-unit:
42+
needs: unit
43+
steps:
7044
- name: Combine coverage
7145
run: python .github/workflows/run_tests.py combine
7246

@@ -81,32 +55,37 @@ jobs:
8155
run: python -m coveralls --service=github
8256

8357
behave:
84-
runs-on: ${{ matrix.os }}-latest
58+
runs-on: ${{ matrix.os }}
8559
env:
8660
DCS: ${{ matrix.dcs }}
8761
ETCDVERSION: 3.4.23
8862
PGVERSION: 16.1-1 # for windows and macos
8963
strategy:
9064
fail-fast: false
9165
matrix:
92-
os: [ubuntu]
93-
python-version: [3.7, '3.10']
66+
os: [ubuntu-latest]
67+
python-version: [3.7, 3.12]
9468
dcs: [etcd, etcd3, consul, exhibitor, kubernetes, raft]
69+
exclude:
70+
- os: ubuntu-latest
71+
python-version: 3.7
9572
include:
96-
- os: macos
73+
- os: ubuntu-22.04
74+
python-version: 3.7
75+
- os: macos-latest
9776
python-version: 3.8
9877
dcs: raft
99-
- os: macos
78+
- os: macos-latest
10079
python-version: 3.9
10180
dcs: etcd
102-
- os: macos
81+
- os: macos-latest
10382
python-version: 3.11
10483
dcs: etcd3
10584

10685
steps:
107-
- uses: actions/checkout@v3
86+
- uses: actions/checkout@v4
10887
- name: Set up Python
109-
uses: actions/setup-python@v4
88+
uses: actions/setup-python@v5
11089
with:
11190
python-version: ${{ matrix.python-version }}
11291
- uses: nolar/setup-k3d-k3s@v1

0 commit comments

Comments
 (0)