Skip to content

Commit d071284

Browse files
authored
Add GHA Workflow to run tests on each supported Python version and OS (#114)
1 parent 0cf86da commit d071284

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
name: Unit Tests
1+
name: Unit Tests on the lower supported Python version
22

3-
on: [push]
3+
on: [ push ]
44

55
permissions:
66
contents: read
77

88
jobs:
9-
deploy:
9+
unit_tests:
1010
runs-on: ubuntu-latest
1111

1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515

1616
- name: Set up Python
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1818
with:
1919
python-version: '3.7'
2020

2121
- name: Setup Poetry
22-
run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python
22+
uses: snok/install-poetry@v1
2323

2424
- name: Install dependencies
2525
run: poetry install

.github/workflows/tests_full.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Unit Tests on all supported Python versions and OS
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
unit_tests:
13+
strategy:
14+
matrix:
15+
os: [ macos-latest, ubuntu-latest, windows-latest ]
16+
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
17+
18+
runs-on: ${{matrix.os}}
19+
20+
defaults:
21+
run:
22+
shell: bash
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v3
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Setup Poetry
34+
uses: snok/install-poetry@v1
35+
36+
- name: Install dependencies
37+
run: poetry install
38+
39+
- name: Run Tests
40+
run: poetry run pytest

0 commit comments

Comments
 (0)