-
Notifications
You must be signed in to change notification settings - Fork 60
96 lines (80 loc) · 2.5 KB
/
validate.yml
File metadata and controls
96 lines (80 loc) · 2.5 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Validate
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate-editorconfig:
name: Check EditorConfig Compliance
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install EditorConfig Checker
uses: taiki-e/install-action@v2
with:
tool: editorconfig-checker
fallback: none
- name: Check EditorConfig Compliance
run: editorconfig-checker --exclude LICENSE
validate-toml:
name: Validate TOML Files
needs: validate-editorconfig
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Taplo
uses: taiki-e/install-action@v2
with:
tool: taplo
fallback: none
- name: Validate TOML Formatting
run: taplo fmt --check
- name: Validate TOML Against Schemas
run: taplo check
validate-rules:
name: Validate Governance Rules
needs: validate-toml
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run Governance Validator
run: RUST_LOG=info cargo run --release --bin governance
env:
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SYNC_GITHUB_TOKEN: ${{ secrets.SYNC_GITHUB_TOKEN }}
validate-codeowners:
name: Validate CODEOWNERS
if: github.event_name == 'push' # only run on push, not PRs since it fails on forks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: GitHub CODEOWNERS Validator
uses: mszostok/[email protected]
with:
checks: "files,duppatterns,syntax"
experimental_checks: "notowned,avoid-shadowing"
# downgrading to 0.7.2 for owners check to avoid issues with token permissions check,
# see https://github.com/mszostok/codeowners-validator/issues/224
- name: GitHub CODEOWNERS Validator
uses: mszostok/[email protected]
with:
checks: "owners"
github_access_token: "${{ secrets.SYNC_GITHUB_TOKEN }}"