Skip to content

Commit fe769dd

Browse files
0xdeafbeefzaidoon1
authored andcommitted
speed up ci
1 parent da9aae6 commit fe769dd

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

.github/workflows/rust.yml

+32-6
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,30 @@ jobs:
3030
with:
3131
components: rust-docs
3232

33+
- uses: Swatinem/rust-cache@v2
34+
with:
35+
cache-on-failure: true
36+
3337
- name: Run cargo rustdoc
3438
run: cargo rustdoc -- -D warnings
3539

40+
doctest: # doctest are no supported in cargo nextest yet. https://github.com/nextest-rs/nextest/issues/16
41+
name: Doctests
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout sources
45+
uses: actions/checkout@v4
46+
47+
- name: Install rust
48+
uses: dtolnay/rust-toolchain@stable
49+
50+
- uses: Swatinem/rust-cache@v2
51+
with:
52+
cache-on-failure: true
53+
54+
- name: Run doctests
55+
run: cargo test --doc
56+
3657
clippy:
3758
name: Clippy
3859
runs-on: ubuntu-latest
@@ -44,7 +65,9 @@ jobs:
4465
uses: dtolnay/rust-toolchain@stable
4566
with:
4667
components: clippy
47-
68+
- uses: Swatinem/rust-cache@v2
69+
with:
70+
cache-on-failure: true
4871
- name: Install dependencies
4972
run: sudo apt-get update && sudo apt-get install -y liburing-dev pkg-config
5073
- name: Set PKG_CONFIG_PATH
@@ -104,6 +127,11 @@ jobs:
104127
- name: Install rust
105128
uses: dtolnay/rust-toolchain@stable
106129

130+
- uses: Swatinem/rust-cache@v2
131+
with:
132+
cache-on-failure: true
133+
- uses: taiki-e/install-action@nextest
134+
107135
- name: Remove msys64 # Workaround to resolve link error with C:\msys64\mingw64\bin\libclang.dll
108136
if: runner.os == 'Windows'
109137
run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
@@ -113,7 +141,6 @@ jobs:
113141
run: choco install llvm -y
114142

115143
- name: Mark working directory as read-only
116-
# to ensure that the tests always use a temporary directory
117144
if: runner.os == 'Linux'
118145
run: |
119146
mkdir -p target
@@ -124,8 +151,8 @@ jobs:
124151
125152
- name: Run rocksdb tests
126153
run: |
127-
cargo test --all
128-
cargo test --all --features multi-threaded-cf
154+
cargo nextest run --all
155+
cargo nextest run --all --features multi-threaded-cf
129156
130157
- name: Mark working directory as writable
131158
if: runner.os == 'Linux'
@@ -135,7 +162,6 @@ jobs:
135162
run: cargo clean
136163

137164
- name: Mark working directory as read-only
138-
# to ensure that the tests always use a temporary directory
139165
if: runner.os == 'Linux'
140166
run: |
141167
mkdir -p target
@@ -145,7 +171,7 @@ jobs:
145171
146172
- name: Run rocksdb tests (jemalloc)
147173
if: runner.os != 'Windows'
148-
run: cargo test --all --features jemalloc
174+
run: cargo nextest run --all --features jemalloc
149175

150176
- name: Mark working directory as writable
151177
if: runner.os == 'Linux'

0 commit comments

Comments
 (0)