-
-
Notifications
You must be signed in to change notification settings - Fork 21
65 lines (53 loc) · 1.49 KB
/
check-pr.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
# This workflow runs pre-commit hooks on the files in the PR only.
#
# Author: Stefanie Molin
name: Check PR
on:
pull_request:
paths:
- 'docs/**'
- 'src/**'
- 'tests/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# Run pre-commit checks on all files
linting:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.11"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit
pre-commit install
- name: Run Checks
run: |
pre-commit run --all-files --show-diff-on-failure
# Check that docs can be built
docs:
runs-on: ubuntu-latest
name: Build docs
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install '.[docs]'
- name: Sphinx build
run: |
cd docs
make html