-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (76 loc) · 2.47 KB
/
Copy pathquality.yml
File metadata and controls
86 lines (76 loc) · 2.47 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
name: Quality
on:
push:
branches: [main]
pull_request:
schedule:
- cron: '0 6 * * 1' # Mondays 06:00 UTC — pick up new advisories
workflow_dispatch:
jobs:
stub-checks:
name: Stub checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Find stub directory
id: stub
run: |
DIR=$(find stubs -mindepth 1 -maxdepth 1 -type d | head -1)
echo "dir=$DIR" >> "$GITHUB_OUTPUT"
- name: cargo fmt
if: steps.stub.outputs.dir
working-directory: ${{ steps.stub.outputs.dir }}
run: cargo fmt -- --check
- name: cargo clippy
if: steps.stub.outputs.dir
working-directory: ${{ steps.stub.outputs.dir }}
run: cargo clippy --all-targets -- -D warnings
- name: cargo build
if: steps.stub.outputs.dir
working-directory: ${{ steps.stub.outputs.dir }}
run: cargo build --release
audit:
name: cargo-audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Find stub directory
id: stub
run: |
DIR=$(find stubs -mindepth 1 -maxdepth 1 -type d | head -1)
echo "dir=$DIR" >> "$GITHUB_OUTPUT"
- name: Generate Cargo.lock
if: steps.stub.outputs.dir
working-directory: ${{ steps.stub.outputs.dir }}
run: cargo generate-lockfile
- name: Audit
if: steps.stub.outputs.dir
uses: rustsec/audit-check@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{ steps.stub.outputs.dir }}
license-consistency:
name: License consistency
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check license trio is present
run: |
set -e
test -f LICENSE
grep -q "Business Source License 1.1" LICENSE
test -f examples/LICENSE
grep -q "Apache License" examples/LICENSE
echo "license trio (BSL-1.1 root, Apache-2.0 examples) intact"
- name: Check stub Cargo.toml license-file
run: |
set -e
for cargo in stubs/*/Cargo.toml; do
grep -q '^license-file = "LICENSE"' "$cargo" || (echo "$cargo missing license-file"; exit 1)
test -f "$(dirname "$cargo")/LICENSE"
done
echo "stub license-file references valid"