-
Notifications
You must be signed in to change notification settings - Fork 20
65 lines (60 loc) · 1.89 KB
/
Lint.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
name: Lint
on:
push:
branches:
- main
tags: ["*"]
pull_request:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Setup Julia
uses: julia-actions/setup-julia@v2
with:
version: "1"
- name: Use Julia cache
uses: julia-actions/cache@v2
- name: Install JuliaFormatter.jl
run: |
julia -e 'using Pkg; pkg"add JuliaFormatter@1"' # Version 1 is fixed due to https://github.com/domluna/JuliaFormatter.jl/issues/878
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: touch requirements.txt
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: "pip"
python-version: "3.11"
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: rm requirements.txt
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: SKIP=no-commit-to-branch pre-commit run -a
- name: Debug pre-commit issues
if: failure()
run: git --no-pager diff
link-checker:
name: Link checker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
fail: true
args: --config '.lychee.toml' .