Skip to content

Commit dcda207

Browse files
committed
Split tests from checks
Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
1 parent 74e7c3b commit dcda207

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ jobs:
2929
- name: Check documentation
3030
run: RUSTDOCFLAGS="-Dwarnings" cargo doc --document-private-items --no-deps
3131

32-
build:
33-
name: Execute CI script
32+
check:
33+
name: Check
3434
runs-on: ubuntu-latest
3535
continue-on-error: true
3636
strategy:
3737
matrix:
3838
target:
39+
- x86_64-unknown-linux-gnu
3940
- armv7-unknown-linux-gnueabi
4041
- armv7-unknown-linux-gnueabihf
4142
- arm-unknown-linux-gnueabi
@@ -52,6 +53,34 @@ jobs:
5253
toolchain:
5354
- stable
5455
- "1.66.0" # MSRV
56+
steps:
57+
- uses: actions/checkout@v4
58+
- name: Setup Rust toolchain
59+
uses: actions-rs/toolchain@v1
60+
with:
61+
toolchain: ${{ matrix.toolchain }}
62+
- name: Install Rust target
63+
run: rustup target add ${{ matrix.target }}
64+
- name: Check formatting
65+
run: cargo fmt --all -- --check
66+
- name: Check lints
67+
run: cargo clippy --all-targets -- -D clippy::all -D clippy::cargo
68+
- name: Check source
69+
run: cargo check --target ${{ matrix.target }} --workspace --all-targets
70+
- name: Check all features source
71+
run: cargo check --target ${{ matrix.target }} --all-features --workspace --all-targets
72+
73+
test:
74+
name: Unit tests
75+
runs-on: ubuntu-latest
76+
continue-on-error: true
77+
strategy:
78+
matrix:
79+
target:
80+
- x86_64-unknown-linux-gnu
81+
toolchain:
82+
- stable
83+
- "1.66.0" # MSRV
5584
steps:
5685
- uses: actions/checkout@v4
5786
- name: Setup Rust toolchain

ci.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,4 @@ pushd cryptoki-sys
1111
cargo build --features generate-bindings
1212
popd
1313

14-
# check formatting before going through all the builds
15-
if cargo fmt --version; then
16-
cargo fmt --all -- --check
17-
fi
18-
if cargo clippy --version; then
19-
cargo clippy --all-targets -- -D clippy::all -D clippy::cargo
20-
fi
21-
22-
cargo build
23-
24-
cargo build --all-features
25-
26-
cargo build --target "$TARGET"
27-
28-
cargo test
14+
cargo test --target "$TARGET"

0 commit comments

Comments
 (0)