Skip to content

Commit 644c7f6

Browse files
committed
ci: move to GH actions
1 parent 3b46dac commit 644c7f6

16 files changed

+446
-36
lines changed

.cspell.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version: "0.2"
2+
words:
3+
- clippy
4+
- direnv

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [robjtede]

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
- package-ecosystem: cargo
8+
directory: /
9+
schedule:
10+
interval: weekly
11+
versioning-strategy: lockfile-only

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
merge_group:
7+
types: [checks_requested]
8+
push:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
read_msrv:
20+
name: Read MSRV
21+
uses: actions-rust-lang/msrv/.github/workflows/msrv.yml@main
22+
23+
test:
24+
needs: read_msrv
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
toolchain:
30+
- { name: msrv, version: "${{ needs.read_msrv.outputs.msrv }}" }
31+
- { name: stable, version: stable }
32+
33+
runs-on: ubuntu-latest
34+
35+
name: Test / ${{ matrix.toolchain.name }}
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Install Nix
41+
uses: cachix/install-nix-action@v31
42+
43+
- name: Install Rust (${{ matrix.toolchain.name }})
44+
uses: actions-rust-lang/[email protected]
45+
with:
46+
toolchain: ${{ matrix.toolchain.version }}
47+
48+
- name: Install cargo-nextest
49+
uses: taiki-e/[email protected]
50+
with:
51+
tool: cargo-nextest
52+
53+
- name: Enter Nix devshell
54+
uses: nicknovitski/[email protected]
55+
56+
- name: Downgrade for MSRV
57+
if: matrix.toolchain.name == 'msrv'
58+
run: just downgrade-for-msrv
59+
60+
- name: Test
61+
run: just test-no-coverage

.github/workflows/coverage.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
coverage:
16+
runs-on: ubuntu-latest
17+
name: Coverage
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Nix
22+
uses: cachix/install-nix-action@v31
23+
24+
- name: Install Rust
25+
uses: actions-rust-lang/[email protected]
26+
with:
27+
components: llvm-tools-preview
28+
29+
- name: Enter Nix devshell
30+
uses: nicknovitski/[email protected]
31+
32+
- name: Install cargo-llvm-cov
33+
uses: taiki-e/[email protected]
34+
with:
35+
tool: cargo-llvm-cov
36+
37+
- name: Generate code coverage
38+
run: just test-coverage-codecov
39+
40+
- name: Upload coverage to Codecov
41+
uses: codecov/[email protected]
42+
with:
43+
files: codecov.json
44+
fail_ci_if_error: true
45+
env:
46+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Dependabot Reviewer
2+
3+
on: pull_request_target
4+
5+
permissions:
6+
pull-requests: write
7+
contents: write
8+
9+
jobs:
10+
review-dependabot-pr:
11+
name: Approve PR
12+
runs-on: ubuntu-latest
13+
if: ${{ github.actor == 'dependabot[bot]' }}
14+
env:
15+
PR_URL: ${{ github.event.pull_request.html_url }}
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
steps:
18+
- name: Fetch Dependabot metadata
19+
id: dependabot-metadata
20+
uses: dependabot/[email protected]
21+
22+
- name: Enable auto-merge for Dependabot PRs
23+
run: gh pr merge --auto --squash "$PR_URL"
24+
25+
- name: Approve patch and minor updates
26+
if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch'|| steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'}}
27+
run: |
28+
gh pr review "$PR_URL" --approve --body "I'm **approving** this pull request because **it only includes patch or minor updates**."
29+
30+
- name: Approve major updates of dev dependencies
31+
if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' && steps.dependabot-metadata.outputs.dependency-type == 'direct:development'}}
32+
run: |
33+
gh pr review "$PR_URL" --approve --body "I'm **approving** this pull request because **it only includes major updates of dev dependencies**."
34+
35+
- name: Comment on major updates of normal dependencies
36+
if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' && steps.dependabot-metadata.outputs.dependency-type == 'direct:production'}}
37+
run: |
38+
gh pr comment "$PR_URL" --body "I'm **not approving** this PR because **it includes major updates of normal dependencies**."
39+
gh pr edit "$PR_URL" --add-label "requires-manual-qa"

.github/workflows/lint.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
fmt:
18+
name: Rustfmt
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install Rust
25+
uses: actions-rust-lang/setup-rust-toolchain@v1
26+
with:
27+
components: rustfmt
28+
29+
- name: Format Check
30+
uses: actions-rust-lang/rustfmt@v1
31+
32+
clippy:
33+
name: Clippy
34+
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
37+
checks: write
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Install Rust
43+
uses: actions-rust-lang/setup-rust-toolchain@v1
44+
with:
45+
components: clippy
46+
47+
- name: Clippy Check
48+
uses: giraffate/clippy-action@v1
49+
with:
50+
clippy_flags: --workspace --all-targets --all-features
51+
reporter: github-pr-check
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
54+
docs:
55+
name: Docs
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Install Rust
60+
uses: actions-rust-lang/[email protected]
61+
with:
62+
components: rust-docs
63+
64+
- name: Validate Intra-doc Links
65+
env:
66+
RUSTDOCFLAGS: -D warnings
67+
run: cargo doc --workspace --no-deps --all-features
68+
69+
audit:
70+
name: Audit
71+
runs-on: ubuntu-latest
72+
73+
steps:
74+
- uses: actions/checkout@v4
75+
76+
- name: Install Rust
77+
uses: actions-rust-lang/setup-rust-toolchain@v1
78+
79+
- name: Install cargo-deny
80+
uses: taiki-e/[email protected]
81+
with:
82+
tool: cargo-deny
83+
84+
- name: Audit check
85+
run: cargo deny --all-features check advisories

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
/target
2+
3+
# rust
4+
/target/
25
**/*.rs.bk
3-
Cargo.lock
4-
.idea
6+
7+
# direnv
8+
/.direnv/
9+
10+
# code coverage
11+
/codecov.json
12+
/lcov.info

.gitlab-ci.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)