Skip to content

Commit 8e661df

Browse files
committed
Add github action for tests and linting
1 parent 6211a10 commit 8e661df

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

.github/workflows/tests_full.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Full set of tests for PRs and master branch"
2+
on:
3+
push:
4+
branches:
5+
- "master"
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
tests:
14+
runs-on: ubuntu-20.04
15+
strategy:
16+
matrix:
17+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
18+
name: Python ${{ matrix.python-version }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install Nox
26+
run: pip install nox==2024.03.02
27+
- name: Run tests
28+
run: nox --non-interactive --error-on-missing-interpreter --session "tests-${{ matrix.python-version }}"
29+
30+
lint:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Set up Python 3.9
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: 3.9
38+
- name: Install Nox
39+
run: pip install nox==2024.03.02
40+
- name: Lint
41+
run: nox --non-interactive --error-on-missing-interpreter --session "lint"

.github/workflows/tests_reduced.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Reduced set of tests for push events"
2+
on:
3+
push:
4+
branches-ignore:
5+
- master
6+
7+
concurrency:
8+
group: ${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
tests:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ["3.11"]
17+
name: Python ${{ matrix.python-version }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install Nox
25+
run: pip install nox==2024.03.02
26+
- name: Run tests
27+
run: nox --non-interactive --error-on-missing-interpreter --session "tests-${{ matrix.python-version }}"
28+
29+
lint:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Set up Python 3.9
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: 3.9
37+
- name: Install Nox
38+
run: pip install nox==2024.03.02
39+
- name: Lint
40+
run: nox --non-interactive --error-on-missing-interpreter --session "lint"

0 commit comments

Comments
 (0)