-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (56 loc) · 2.26 KB
/
pr-checks.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
53
54
55
56
57
58
name: PR-CHECKS
on:
pull_request:
jobs:
run-pr-checks:
runs-on: ${{ matrix.os }} # This is defined by the strategy below
strategy:
# The strategy allows to automatically test different os and python version combinations
fail-fast: true # The PR checks should fail fast not to waste GitHub minutes
matrix:
# For reproducibility, we define ubuntu-20.04 rather than ubuntu-latest. PR-CHECKS should only test default.
os: [ ubuntu-20.04 ]
# PR-CHECKS should only test default python distribution.
python-version: [ '3.11' ]
steps:
- name: Checkout current branch
# Required to fetch all changes in the current PR
uses: actions/checkout@v4
with:
fetch-depth: 2 # 2 fetches previous commit, apparently ok for pull_request:
- name: Set up python
uses: actions/setup-python@v5
with:
architecture: x64 # Default architecture most systems operate on
python-version: ${{ matrix.python-version }} # This is defined by the strategy above
- name: Load cached venv
# Cache local .venv, the packages downloaded by poetry into custom cache .pypoetry and ~/.local (poetry itself)
uses: actions/cache@v4
with:
path: |
.venv
.pypoetry
~/.local
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-
- name: Install and configure poetry
uses: snok/install-poetry@v1
with:
installer-parallel: true
version: 1.8.3 # This should be a specific micro version for reproducibility
- name: Set poetry cache
# To have a consistent cache directory between different os (linux/macosx)
run: poetry config cache-dir .pypoetry
- name: Poetry update lock and install virtual environment
run: make update-install && poetry show
- name: Run code format checks
run: make format-check
- name: Run type checking
run: make lint
- name: Run security checking
run: make security-lint
- name: Run interrogate documentation coverage check
run: make interrogate
- name: Run package tests
run: make test