forked from CCRI-POPROX/poprox-recommender
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.14 KB
/
check-source.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
name: Validate Source
on:
push:
branches:
- main
pull_request:
jobs:
check-pre-commit:
name: Check that the pre-commit hooks have run
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pre-commit
run: |
pipx install pre-commit
- name: Install pre-commit hooks
run: |
pre-commit install-hooks
- name: Check source repo
run: |
if pre-commit run --all-files; then
echo "::notice title=pre-commit::pre-commit checks passed"
else
git status -s |sed -Ee 's/^...(.*)/::error file=\1,title=pre-commit::pre-commit wants to modify file/'
echo "::error title=pre-commit::committed code does not cleanly pass pre-commit"
exit 1
fi
ruff-lint:
name: Report lint failures
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Ruff lint and report
run: |
pipx run ruff check --output-format=github