Skip to content

Commit 95d9ae7

Browse files
committed
Add github action for tests and linting
1 parent 6211a10 commit 95d9ae7

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

.github/workflows/tests_full.yaml

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

.github/workflows/tests_reduced.yaml

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

0 commit comments

Comments
 (0)