-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (49 loc) · 1.48 KB
/
test.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
46
47
48
49
50
51
52
# This pipeline checks whether the package
# installs properly, passes unit tests and whether
# the code formatting is right.
name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
poetry-version: ["1.3.2"]
steps:
- uses: actions/checkout@v3
- name: Run black formatting check
uses: psf/[email protected]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
version: ${{ matrix.poetry-version }}
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- name: Install the dependencies
run: poetry install --no-interaction --no-root --with dev
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Install the module
run: poetry install --with dev --no-interaction
- name: Run unit tests
run: poetry run pytest
- name: Run Ruff
run: poetry run ruff check .
#- name: Run Pyright (type checking)
#run: poetry run pyright