Skip to content

Commit 4f9bf7a

Browse files
committed
ci: upgrade workflows from bind9-sdk patterns and add LICENSE.md
CLA workflow: - Pin ubuntu-24.04, add timeout, injection safety comment - Use dedicated cla-signatures branch instead of development - Versioned signature path (signatures/version1/cla.json) - Add renovate[bot] to allowlist, lock PRs after merge CI workflow: - Pin ubuntu-24.04, RUST_TOOLCHAIN env var, RUSTFLAGS=-Dwarnings - Add concurrency group (cancel in-progress on same ref) - Add permissions: contents: read (least privilege) - Add job dependencies (clippy/test/msrv need fmt first) - Add timeouts to all jobs - Add eval feature test job - Add MSRV check, dependency review, REUSE lint jobs LICENSE.md: - Root license file linking to LICENSES/ for GitHub badge display
1 parent 894d0cb commit 4f9bf7a

3 files changed

Lines changed: 101 additions & 35 deletions

File tree

.github/workflows/ci.yml

Lines changed: 68 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,59 +10,107 @@ on:
1010
pull_request:
1111
branches: [development, main]
1212

13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ci-${{ github.ref }}
18+
cancel-in-progress: true
19+
1320
env:
1421
CARGO_TERM_COLOR: always
22+
RUSTFLAGS: -Dwarnings
23+
RUST_TOOLCHAIN: "1.94.0"
1524

1625
jobs:
17-
check:
18-
name: Check (${{ matrix.rust }})
19-
runs-on: ubuntu-latest
20-
strategy:
21-
matrix:
22-
rust: [stable, "1.94"]
26+
fmt:
27+
name: Format
28+
runs-on: ubuntu-24.04
29+
timeout-minutes: 5
2330
steps:
2431
- uses: actions/checkout@v4
2532
- uses: dtolnay/rust-toolchain@master
2633
with:
27-
toolchain: ${{ matrix.rust }}
28-
- uses: Swatinem/rust-cache@v2
29-
- run: cargo check --all-targets
34+
toolchain: ${{ env.RUST_TOOLCHAIN }}
35+
components: rustfmt
36+
- run: cargo fmt --check
3037

3138
clippy:
3239
name: Clippy
33-
runs-on: ubuntu-latest
40+
needs: fmt
41+
runs-on: ubuntu-24.04
42+
timeout-minutes: 15
3443
steps:
3544
- uses: actions/checkout@v4
36-
- uses: dtolnay/rust-toolchain@stable
45+
- uses: dtolnay/rust-toolchain@master
3746
with:
47+
toolchain: ${{ env.RUST_TOOLCHAIN }}
3848
components: clippy
3949
- uses: Swatinem/rust-cache@v2
4050
- run: cargo clippy --all-targets -- -D warnings
4151

4252
test:
4353
name: Test
44-
runs-on: ubuntu-latest
54+
needs: fmt
55+
runs-on: ubuntu-24.04
56+
timeout-minutes: 15
4557
steps:
4658
- uses: actions/checkout@v4
47-
- uses: dtolnay/rust-toolchain@stable
59+
- uses: dtolnay/rust-toolchain@master
60+
with:
61+
toolchain: ${{ env.RUST_TOOLCHAIN }}
4862
- uses: Swatinem/rust-cache@v2
4963
- run: cargo test --all-targets
5064

51-
fmt:
52-
name: Format
53-
runs-on: ubuntu-latest
65+
test-eval:
66+
name: Test (eval)
67+
needs: fmt
68+
runs-on: ubuntu-24.04
69+
timeout-minutes: 15
5470
steps:
5571
- uses: actions/checkout@v4
56-
- uses: dtolnay/rust-toolchain@stable
72+
- uses: dtolnay/rust-toolchain@master
5773
with:
58-
components: rustfmt
59-
- run: cargo fmt --check
74+
toolchain: ${{ env.RUST_TOOLCHAIN }}
75+
- uses: Swatinem/rust-cache@v2
76+
- run: cargo test --all-targets --features eval
77+
78+
msrv:
79+
name: MSRV Check
80+
needs: fmt
81+
runs-on: ubuntu-24.04
82+
timeout-minutes: 10
83+
steps:
84+
- uses: actions/checkout@v4
85+
- uses: dtolnay/rust-toolchain@master
86+
with:
87+
toolchain: ${{ env.RUST_TOOLCHAIN }}
88+
- uses: Swatinem/rust-cache@v2
89+
- run: cargo check --all-targets
90+
91+
dependency-review:
92+
name: Dependency Review
93+
if: github.event_name == 'pull_request'
94+
runs-on: ubuntu-24.04
95+
timeout-minutes: 5
96+
steps:
97+
- uses: actions/checkout@v4
98+
- uses: actions/dependency-review-action@v4
6099

61100
audit:
62101
name: Security Audit
63-
runs-on: ubuntu-latest
102+
runs-on: ubuntu-24.04
103+
timeout-minutes: 5
64104
steps:
65105
- uses: actions/checkout@v4
66106
- uses: rustsec/audit-check@v2
67107
with:
68108
token: ${{ secrets.GITHUB_TOKEN }}
109+
110+
reuse:
111+
name: REUSE Lint
112+
runs-on: ubuntu-24.04
113+
timeout-minutes: 5
114+
steps:
115+
- uses: actions/checkout@v4
116+
- uses: fsfe/reuse-action@v4

.github/workflows/cla.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,46 @@
22
#
33
# SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
44

5-
name: CLA Assistant
5+
name: CLA
66

77
on:
88
issue_comment:
99
types: [created]
1010
pull_request_target:
1111
types: [opened, closed, synchronize]
1212

13+
# Note: github.event.comment.body in the step-level `if:` is evaluated by
14+
# the GHA runner (not shell-interpolated) — no injection risk.
15+
1316
permissions:
1417
actions: write
1518
contents: write
1619
pull-requests: write
1720
statuses: write
1821

1922
jobs:
20-
cla:
21-
if: |
22-
(github.event_name == 'pull_request_target')
23-
|| (github.event_name == 'issue_comment' && github.event.comment.body == 'recheck')
24-
|| (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, 'I have read the CLA'))
25-
runs-on: ubuntu-latest
23+
cla-check:
24+
name: CLA Signature
25+
runs-on: ubuntu-24.04
26+
timeout-minutes: 5
2627
steps:
2728
- uses: contributor-assistant/github-action@v2.6.1
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
if: >-
30+
github.event_name == 'pull_request_target'
31+
|| github.event.comment.body == 'recheck'
32+
|| github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA'
3033
with:
31-
path-to-document: "CLA.md"
32-
path-to-signatures: "signatures/cla.json"
33-
branch: "development"
34-
allowlist: "Sephyi,dependabot[bot],github-actions[bot]"
34+
path-to-document: "https://github.com/${{ github.repository }}/blob/development/CLA.md"
35+
path-to-signatures: "signatures/version1/cla.json"
36+
branch: "cla-signatures"
37+
allowlist: "Sephyi,dependabot[bot],renovate[bot],github-actions[bot]"
38+
lock-pullrequest-aftermerge: true
3539
custom-notsigned-prcomment: >-
3640
Thank you for your contribution! Before we can merge this PR,
37-
you need to sign the Contributor License Agreement (CLA.md).
41+
you need to sign the [Contributor License Agreement](CLA.md).
3842
To sign, please reply with a comment containing exactly:
3943
`I have read the CLA Document and I hereby sign the CLA.`
4044
You only need to sign once.
4145
custom-pr-sign-comment: "I have read the CLA Document and I hereby sign the CLA."
42-
lock-pullrequest-aftermerge: false
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

LICENSE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2026 Sephyi <me@sephy.io>
3+
4+
SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
5+
-->
6+
7+
# License
8+
9+
CommitBee is licensed under [PolyForm Noncommercial 1.0.0](LICENSES/PolyForm-Noncommercial-1.0.0.txt).
10+
11+
You may use, modify, and distribute this software for any noncommercial purpose. Commercial use requires a separate license — contact [me@sephy.io](mailto:me@sephy.io).
12+
13+
This project is [REUSE](https://reuse.software/) compliant. Every source file carries SPDX headers identifying its copyright and license.

0 commit comments

Comments
 (0)