-
Notifications
You must be signed in to change notification settings - Fork 12
52 lines (44 loc) · 1.36 KB
/
qa.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
42
43
44
45
46
47
48
49
50
51
52
name: Quality Assurance
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
with:
# KLUDGE: This separator, in combination with the leading and trailing single quotes
# in the pre-commit command below, handle file names with spaces.
separator: "' '"
- name: Set Python up
uses: actions/setup-python@v4
id: set-python-up
with:
cache: pip
cache-dependency-path: requirements-qa.txt
python-version-file: .python-version
- name: Install pre-commit
run: pip install -r requirements-qa.txt
- name: Cache pre-commit environments
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit/
key: pre-commit-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: |
pre-commit run --color=always --files '${{ steps.changed-files.outputs.all_changed_files }}'