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
name: CI
on:
pull_request:
branches:
permissions:
contents: write
pull-requests: write
jobs:
# ── Rust build + test (native cargo) ──
# Fast feedback: fmt, clippy, test run directly without installing homeboy.
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: cargo fmt --check
run: cargo fmt --check
- name: cargo clippy
run: cargo clippy --all-targets -- -W clippy::all
- name: cargo test
run: cargo test
# ── Homeboy audit (dogfooding via homeboy-action) ──
# Uses source build mode to compile from the PR branch, avoiding the
# chicken-and-egg problem of needing a released binary to audit itself.
# Falls back to latest release binary if source build fails.
# Runs independently of build job so PR comments are always posted.
# Autofix enabled: on audit failure, applies safe fixes and commits back to the PR.
audit:
name: Homeboy Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: Extra-Chill/homeboy-action@v1
with:
source: '.'
extension: rust
component: homeboy
commands: audit
autofix: 'true'
autofix-commands: 'audit --fix --write'
autofix-max-commits: '2'