-
Notifications
You must be signed in to change notification settings - Fork 32
93 lines (86 loc) · 2.39 KB
/
TestingCI.yml
File metadata and controls
93 lines (86 loc) · 2.39 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
name: Rust
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy
run: |
# First pass: show all warnings (don't fail)
cargo clippy --all-targets 2>&1 || true
# Second pass: fail if any warnings exist
cargo clippy --all-targets -- -D warnings
linux-ubuntu:
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: System info
run: |
echo "=== Architecture ==="
uname -a
echo "=== CPU ==="
lscpu | head -20
echo "=== Toolchain ==="
rustc --version
cargo --version
cc --version || true
as --version || true
- name: Fetch
run: cargo fetch
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --release --verbose
macos-homebrew:
needs: lint
runs-on: macos-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: System info
run: |
echo "=== Architecture ==="
uname -a
arch
echo "=== Toolchain ==="
rustc --version
cargo --version
cc --version || true
as -version || true
echo "=== Xcode ==="
xcodebuild -version || true
- name: Fetch
run: cargo fetch
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --release --verbose
- name: Run cc tests (detailed)
if: failure()
run: |
echo "=== Re-running cc tests with more detail ==="
cargo test --release -p posixutils-cc --verbose -- --nocapture --test-threads=1 2>&1 | head -500