Skip to content

Commit 60122f0

Browse files
committed
add github action configuration for test jobs
1 parent 9f5f932 commit 60122f0

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

.github/workflows/test.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Test
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
9+
# Test different python versions with bash on Ubuntu.
10+
ubuntu:
11+
name: Test Ubuntu
12+
runs-on: ubuntu-latest
13+
if: ${{ !startsWith(github.ref, 'refs/tags') }}
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version:
19+
- 3.8
20+
- 3.9
21+
- "3.10"
22+
- "3.11"
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
34+
- name: Install dependencies
35+
run: python -m pip install tox
36+
37+
- name: Run tests
38+
run: tox -e py
39+
40+
# Test the latest python version with zsh on macOS
41+
zsh:
42+
name: Test Zsh
43+
runs-on: macos-latest
44+
if: ${{ !startsWith(github.ref, 'refs/tags') }}
45+
46+
strategy:
47+
fail-fast: false
48+
49+
steps:
50+
- uses: actions/checkout@v3
51+
with:
52+
fetch-depth: 0
53+
54+
- name: Set up Python ${{ matrix.python-version }}
55+
uses: actions/setup-python@v4
56+
57+
- name: Install dependencies
58+
run: python -m pip install tox
59+
60+
- name: Run tests
61+
run: tox -e zsh
62+
63+
# Test different python versions with bash on macOS
64+
macos:
65+
name: Test macOS
66+
runs-on: macos-latest
67+
if: ${{ !startsWith(github.ref, 'refs/tags') }}
68+
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
python-version:
73+
- 3.8
74+
- 3.9
75+
- "3.10"
76+
- "3.11"
77+
78+
steps:
79+
- uses: actions/checkout@v3
80+
with:
81+
fetch-depth: 0
82+
83+
- name: Set up Python ${{ matrix.python-version }}
84+
uses: actions/setup-python@v4
85+
with:
86+
python-version: ${{ matrix.python-version }}
87+
88+
- name: Install dependencies
89+
run: python -m pip install tox
90+
91+
- name: Run tests
92+
run: tox -e py
93+
94+
# Run various style checkers
95+
style:
96+
runs-on: ubuntu-latest
97+
if: ${{ !startsWith(github.ref, 'refs/tags') }}
98+
99+
strategy:
100+
fail-fast: false
101+
tox-environment:
102+
- docs
103+
- style
104+
- pkglint
105+
106+
steps:
107+
- uses: actions/checkout@v3
108+
with:
109+
fetch-depth: 0
110+
111+
- name: Set up Python
112+
uses: actions/setup-python@v4
113+
114+
- name: Install dependencies
115+
run: python -m pip install tox
116+
117+
- name: Run
118+
run: tox -e ${{ matrix.tox-environment }}

0 commit comments

Comments
 (0)