-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 975 Bytes
/
code-quality.yaml
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
name: Code Quality checks for PRs
on:
pull_request:
jobs:
checks:
name: Pre-Commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10.9'
- name: Set up cache
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
- name: Install Poetry
run: |
pip install -U pip
pip install poetry
poetry config virtualenvs.in-project true
poetry install
- name: Run linting and other code quality checks
run: |
poetry run pre-commit run --all-files
- name: Run tests
run: export PYTHONPATH=$PYTHONPATH:$(pwd); poetry run pytest -c pyproject.toml
- name: Run security checks
run: |
poetry check
poetry run safety check --full-report