88
99jobs :
1010 build :
11- name : build
12- runs-on : ${{ matrix.os }}
13- strategy :
14- fail-fast : false
15- matrix :
16- os : [macos-latest, ubuntu-latest]
11+ runs-on : ubuntu-22.04
1712 steps :
18- - uses : actions/checkout@v2
13+ - uses : actions/checkout@v3
14+
15+ - name : Set up cargo cache
16+ uses : actions/cache@v3
17+ continue-on-error : false
18+ with :
19+ path : |
20+ ~/.cargo/bin/
21+ ~/.cargo/registry/index/
22+ ~/.cargo/registry/cache/
23+ ~/.cargo/git/db/
24+ target/
25+ key : ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
26+ restore-keys : ${{ runner.os }}-cargo-release-
27+
1928 - name : Build
20- run : cargo build --verbose
21- - name : Run tests
22- run : cargo test --verbose
29+ run : cargo build --release --verbose
30+
31+ - name : Upload binary
32+ uses : actions/upload-artifact@v3
33+ with :
34+ name : bin
35+ path : target/release/rshijack
2336
2437 cross :
2538 runs-on : ubuntu-latest
4760 binutils : s390x-linux-gnu
4861 steps :
4962 - name : Install binutils
50- run : sudo apt-get install binutils-${{ matrix.arch.binutils }}
63+ run : |
64+ sudo apt-get update
65+ sudo apt-get install -y binutils-${{ matrix.arch.binutils }}
5166 if : matrix.arch.binutils
5267 - uses : actions/checkout@v2
5368 - uses : actions-rs/toolchain@v1
@@ -68,18 +83,36 @@ jobs:
6883 name : rshijack-${{ matrix.arch.name }}
6984 path : target/${{ matrix.arch.name }}/release/rshijack
7085
71- clippy :
72- name : clippy
73- runs-on : ubuntu-latest
86+ unit-test :
87+ runs-on : ${{ matrix.os }}
88+ strategy :
89+ fail-fast : false
90+ matrix :
91+ os : [macos-latest, ubuntu-22.04]
7492 steps :
75- - uses : actions/checkout@v2
76- - uses : actions-rs/toolchain@v1
77- with :
78- profile : minimal
79- toolchain : stable
80- override : true
81- components : clippy
82- - uses : actions-rs/cargo@v1
93+ - uses : actions/checkout@v3
94+
95+ - name : Set up cargo cache
96+ uses : actions/cache@v3
97+ continue-on-error : false
8398 with :
84- command : clippy
85- args : --workspace --tests -- --deny warnings
99+ path : |
100+ ~/.cargo/bin/
101+ ~/.cargo/registry/index/
102+ ~/.cargo/registry/cache/
103+ ~/.cargo/git/db/
104+ target/
105+ key : ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }}
106+ restore-keys : ${{ runner.os }}-cargo-debug-
107+
108+ - name : Run clippy
109+ run : cargo clippy -- -D warnings
110+ - name : Run tests
111+ run : cargo test --verbose
112+
113+ fmt :
114+ runs-on : ubuntu-22.04
115+ steps :
116+ - uses : actions/checkout@v3
117+ - name : Run cargo fmt
118+ run : cargo fmt --all -- --check
0 commit comments