-
Notifications
You must be signed in to change notification settings - Fork 3
65 lines (59 loc) · 1.58 KB
/
linter.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: linter
permissions:
contents: read
# To report GitHub Actions status checks
statuses: write
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
inputs:
commit_sha:
description: Git commit sha, on which, to run this workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
# configure sccache to cache the build artifacts (on github caches)
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
lint_commits:
name: Lint Commit Messages
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check Commit Lint
uses: wagoid/commitlint-github-action@v6
lint_check:
name: Rust - lint_${{ matrix.lint_projects }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lint_projects:
- cargo_fmt_check
- cargo_toml_fmt_files
- cargo_clippy
- cargo_deny
steps:
- name: Run the checkout command
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: "true"
- uses: mozilla-actions/[email protected]
- uses: jdx/mise-action@v2
- run: mise install
shell: bash
- name: Check cargo version
run: cargo --version
- name: Run ${{ matrix.lint_projects }}
run: make -f Makefile lint_${{ matrix.lint_projects }}
- run: ${SCCACHE_PATH} --show-stats
shell: bash