-
Notifications
You must be signed in to change notification settings - Fork 3
91 lines (83 loc) · 2.28 KB
/
Copy pathQA.yaml
File metadata and controls
91 lines (83 loc) · 2.28 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
name: QA
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --verbose
lint:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --check
- name: Run clippy
run: cargo clippy -- -D warnings
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose
- name: Build release
run: cargo build --release --verbose
# SCA: Dependency vulnerability scanning
security-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Cache cargo-audit
uses: actions/cache@v5
id: cache-audit
with:
path: ~/.cargo/bin/cargo-audit
key: cargo-audit-0.21
- name: Install cargo-audit
if: steps.cache-audit.outputs.cache-hit != 'true'
run: cargo install cargo-audit --locked
- name: Run security audit
run: cargo audit --deny warnings
# Secrets scanning
secrets-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Run gitleaks
uses: gitleaks/gitleaks-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
# License and supply chain compliance
dependency-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Cache cargo-deny
uses: actions/cache@v5
id: cache-deny
with:
path: ~/.cargo/bin/cargo-deny
key: cargo-deny-0.18
- name: Install cargo-deny
if: steps.cache-deny.outputs.cache-hit != 'true'
run: cargo install cargo-deny --locked
- name: Check dependencies
run: cargo deny check