-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.23 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: tests
on:
push:
branches: [main]
pull_request:
jobs:
tests:
runs-on: ubuntu-20.04
strategy:
max-parallel: 4
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# cache the Python environment, including installed dependencies
# (unique to each python-version; speeds up tests more than caching pip cache)
- name: Cache/Restore the Python env
uses: actions/cache@v3
env:
cache-name: cache-python${{ matrix.python-version }}-env
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
- name: Install pip
run: |
pip install --upgrade pip
- name: Install with test dependencies
run: |
pip install .[test]
- name: Lint with ruff
run: |
pip install ruff
ruff check .
- name: Check types with MyPy
run: |
mypy src/as4012_sstr --pretty
- name: Run tests
run: |
pytest