-
Notifications
You must be signed in to change notification settings - Fork 11
58 lines (49 loc) · 1.7 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
53
54
55
56
57
58
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@v41
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@v5
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 }}'
# The reason for running the link check against all rather than just changed files is we can
# end up with a situation where a non-markdown file is removed that causes a broken link (e.g. a screenshot).
- name: Run link check against all files
run: |
pre-commit run --color=always --all-files markdown-link-check