forked from ferronweb/ferron
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (83 loc) · 2.38 KB
/
rust-v2.yml
File metadata and controls
99 lines (83 loc) · 2.38 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
92
93
94
95
96
97
98
99
name: Rust (Ferron 2.x)
on:
push:
branches: ["develop-2.x"]
paths:
- "Cargo.lock"
- "Cargo.toml"
- "ferron/**"
- "ferron-common/**"
- "ferron-dns-builtin/**"
- "ferron-load-modules/**"
- "ferron-modules-builtin/**"
- "ferron-passwd/**"
- "ferron-precompress/**"
- "ferron-yaml2kdl/**"
- "ferron-yaml2kdl-core/**"
- "ferron-build.yaml"
- "ferron-build-override.yaml"
- "smoketest/**"
- ".github/workflows/rust-v2.yml"
pull_request:
branches: ["develop-2.x"]
paths:
- "Cargo.lock"
- "Cargo.toml"
- "ferron/**"
- "ferron-common/**"
- "ferron-dns-builtin/**"
- "ferron-load-modules/**"
- "ferron-modules-builtin/**"
- "ferron-passwd/**"
- "ferron-precompress/**"
- "ferron-yaml2kdl/**"
- "ferron-yaml2kdl-core/**"
- "ferron-build.yaml"
- "ferron-build-override.yaml"
- ".github/workflows/rust-v2.yml"
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Run Cargo tests
run: cargo test --workspace --verbose
- name: Build binaries
shell: bash
run: |
make build-dev CARGO_FINAL_EXTRA_ARGS="--verbose"
- name: Smoke test the binary
shell: bash
run: |
FERRON="$(pwd)/target/debug/ferron" bash smoketest/smoketest.sh
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check linting
run: cargo clippy --workspace -- -D warnings
depcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install "cargo shear"
run: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cargo-shear --force
- name: Check for unused dependencies
run: cargo shear