Skip to content

Commit f0f9317

Browse files
committed
ci: add github actions workflow
1 parent 7d46dfd commit f0f9317

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Tests
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
build:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy2.7", "pypy3.9"]
13+
include:
14+
- check-types: true
15+
- python-version: "2.7"
16+
container: "python:2.7.18-buster"
17+
check-types: false
18+
- python-version: "3.5"
19+
check-types: false
20+
- python-version: "pypy2.7"
21+
check-types: false
22+
23+
runs-on: ubuntu-20.04
24+
container: ${{ matrix.container }}
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
29+
- name: Set up Python ${{ matrix.python-version }}
30+
if: ${{ matrix.python-version != '2.7' }}
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Upgrade pip
36+
run: python -m pip install --upgrade pip
37+
38+
- name: Install mypy
39+
if: ${{ matrix.check-types }}
40+
run: python -m pip install mypy
41+
42+
- name: Check Types
43+
if: ${{ matrix.check-types }}
44+
run: mypy periphery
45+
46+
- name: Run tests
47+
run: |
48+
python -m tests.test_gpio
49+
python -m tests.test_gpio_sysfs
50+
python -m tests.test_spi
51+
python -m tests.test_i2c
52+
python -m tests.test_mmio
53+
python -m tests.test_serial
54+
python -m tests.test_led
55+
python -m tests.test_pwm

0 commit comments

Comments
 (0)