-
Notifications
You must be signed in to change notification settings - Fork 16
95 lines (91 loc) · 2.84 KB
/
pull_request.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Code
on:
pull_request:
jobs:
lint:
name: Python Linting
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.10"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt
- name: Cache venv
uses: actions/cache@v3.3.1
with:
path: .venv
key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml','requirements.txt') }}
- run: echo "PRE_COMMIT_HOME=$Env:GITHUB_WORKSPACE/.cache/pre-commit" >> "$Env:GITHUB_ENV"
if: ${{ startsWith(matrix.os, 'windows') }}
- run: echo "PRE_COMMIT_HOME=$GITHUB_WORKSPACE/.cache/pre-commit" >> "$GITHUB_ENV"
if: ${{ !startsWith(matrix.os, 'windows') }}
- name: Cache pre-commit
uses: actions/cache@v3.3.1
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: pre-commit-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install just
uses: extractions/setup-just@v1
with:
just-version: '1.13.0'
- name: Create virtual env, install requirements
run: just deps
- name: Check commit messages
run: just _check-commit-range "refs/remotes/origin/${{ github.base_ref }}..HEAD"
- name: Check linting, formatting, types
run: just --set verbose_errors true -- check-codestyle
test:
name: Python Tests
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.10"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt
- name: Set up Doxygen
uses: ssciwr/doxygen-install@v1.2.0
with:
version: 1.9.8
- name: Set up Graphviz
uses: ts-graphviz/setup-graphviz@v1.2.0
with:
ubuntu-graphviz-version: 2.42.2-6
windows-graphviz-version: '9.0.0'
- name: Cache venv
uses: actions/cache@v3.3.1
with:
path: .venv
key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml','requirements.txt') }}
- name: Install just
uses: extractions/setup-just@v1
with:
just-version: '1.13.0'
- name: Create virtual env, install requirements
run: just deps
- name: Install
run: just install
- name: Run tests
run: just test