-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (38 loc) · 1.05 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
name: Test
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
env: # environment variables (available in any part of the action)
PYTHON_VERSION: 3.12
jobs:
lint-test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Check lock file
run: poetry lock --check
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Test with pytest
run: poetry run pytest
- name: Run black
run: poetry run black --check --config ./pyproject.toml .
- name: Run mypy
run: poetry run mypy --config-file=pyproject.toml
- name: Run ruff
run: poetry run ruff check