-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (101 loc) · 3.35 KB
/
check.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: check
on:
push:
branches:
- main
pull_request:
merge_group:
permissions:
contents: read
env:
MINIMUM_PYTHON_VERSION: "3.8"
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
fmt:
runs-on: ubuntu-latest
name: ubuntu / 3.8 / fmt
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up the python ${{ env.MINIMUM_PYTHON_VERSION }}
uses: pdm-project/setup-pdm@v4
id: setup-python
with:
python-version: ${{ env.MINIMUM_PYTHON_VERSION }}
- name: Load cached venv
id: cached-venv
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/check.yml') }}
- name: Install dependencies
if: steps.cached-venv.outputs.cache-hit != 'true'
run: make install-dev
- name: check formatting
run: make check-fmt
lint:
runs-on: ubuntu-latest
name: ubuntu / 3.8 / lint
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up the python ${{ env.MINIMUM_PYTHON_VERSION }}
uses: pdm-project/setup-pdm@v4
id: setup-python
with:
python-version: ${{ env.MINIMUM_PYTHON_VERSION }}
- name: Load cached venv
id: cached-venv
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/check.yml') }}
- name: Install dependencies
if: steps.cached-venv.outputs.cache-hit != 'true'
run: make install-dev
- name: lint code
run: make lint
type-check:
runs-on: ubuntu-latest
name: ubuntu / 3.8 / type-check
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up the python ${{ env.MINIMUM_PYTHON_VERSION }}
uses: pdm-project/setup-pdm@v4
id: setup-python
with:
python-version: ${{ env.MINIMUM_PYTHON_VERSION }}
- name: Load cached venv
id: cached-venv
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/check.yml') }}
- name: Install dependencies
if: steps.cached-venv.outputs.cache-hit != 'true'
run: make install-dev
- name: type-check code
run: make type-check
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
check-check:
if: always()
needs:
- fmt
- lint
- type-check
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
allowed-failures: upload-coverage