Skip to content

Commit c4ef00f

Browse files
committed
ci: split long lines to make the file more readable
Signed-off-by: Benno Lossin <lossin@kernel.org>
1 parent 1a17c89 commit c4ef00f

File tree

1 file changed

+109
-15
lines changed

1 file changed

+109
-15
lines changed

.github/workflows/ci.yml

Lines changed: 109 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,32 @@ jobs:
6161
- run: cargo install cargo-hack
6262
- run: git config user.name "github-runner" && git config user.email "<>"
6363
# examples and tests require `alloc`, since they make extensive use of `Box` etc.
64-
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset clippy --all-targets --locked --features alloc' --exec 'cargo clean' --root
64+
- run: |
65+
echo '#!/bin/bash
66+
set -e
67+
cargo hack \
68+
--clean-per-run \
69+
--feature-powerset \
70+
clippy \
71+
--all-targets \
72+
--locked \
73+
--features alloc
74+
cargo clean' > exec.sh
75+
git rebase --exec 'bash exec.sh' --root
6576
env:
6677
RUSTFLAGS: "-Dwarnings"
6778
# the core lib does not, so also check that without the alloc feature.
68-
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset clippy --lib --locked' --exec 'cargo clean' --root
79+
- run: |
80+
echo '#!/bin/bash
81+
set -e
82+
cargo hack \
83+
--clean-per-run \
84+
--feature-powerset \
85+
clippy \
86+
--lib \
87+
--locked
88+
cargo clean' > exec.sh
89+
git rebase --exec "bash exec.sh" --root
6990
env:
7091
RUSTFLAGS: "-Dwarnings"
7192
test:
@@ -92,7 +113,11 @@ jobs:
92113
name: "miri (${{matrix.MIRIFLAGS}})"
93114
strategy:
94115
matrix:
95-
MIRIFLAGS: ["", "-Zmiri-tree-borrows", "-Zmiri-strict-provenance", "-Zmiri-tree-borrows -Zmiri-strict-provenance"]
116+
MIRIFLAGS:
117+
- ""
118+
- "-Zmiri-tree-borrows"
119+
- "-Zmiri-strict-provenance"
120+
- "-Zmiri-tree-borrows -Zmiri-strict-provenance"
96121
steps:
97122
- uses: actions/checkout@v4
98123
with:
@@ -134,23 +159,59 @@ jobs:
134159
sudo apt install llvm
135160
- run: git config user.name "github-runner" && git config user.email "<>"
136161
# sed because of https://github.com/japaric/rust-san#unrealiable-leaksanitizer
137-
- run: git rebase --exec "sed -i '/\[features\]/i [profile.dev]' Cargo.toml && sed -i '/profile.dev/a opt-level = 1' Cargo.toml && cargo test --lib --tests --target x86_64-unknown-linux-gnu && git restore Cargo.toml" --root
162+
- run: |
163+
echo "#!/bin/bash
164+
set -e
165+
sed -i '/\[features\]/i [profile.dev]' Cargo.toml \
166+
&& sed -i '/profile.dev/a opt-level = 1' Cargo.toml \
167+
&& cargo test --lib --tests --target x86_64-unknown-linux-gnu \
168+
&& git restore Cargo.toml" > exec.sh
169+
git rebase --exec "bash exec.sh" --root
138170
env:
139171
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
140-
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address -Dwarnings"
172+
RUSTFLAGS: >
173+
--cfg NO_UI_TESTS
174+
--cfg NO_ALLOC_FAIL_TESTS
175+
-Z sanitizer=address
176+
-Dwarnings
141177
# sed because of https://github.com/japaric/rust-san#unrealiable-leaksanitizer
142178
# doctests are strangely not included in --all-targets
143-
- run: git rebase --exec "sed -i '/\[features\]/i [profile.dev]' Cargo.toml && sed -i '/profile.dev/a opt-level = 1' Cargo.toml && cargo test --doc --target x86_64-unknown-linux-gnu && git restore Cargo.toml" --root
179+
- run: |
180+
echo "#!/bin/bash
181+
set -e
182+
sed -i '/\[features\]/i [profile.dev]' Cargo.toml \
183+
&& sed -i '/profile.dev/a opt-level = 1' Cargo.toml \
184+
&& cargo test --doc --target x86_64-unknown-linux-gnu \
185+
&& git restore Cargo.toml" > exec.sh
186+
git rebase --exec "bash exec.sh" --root
144187
env:
145188
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
146-
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address -Dwarnings"
147-
- run: git rebase --exec 'cargo test --all-targets --target x86_64-unknown-linux-gnu' --root
189+
RUSTFLAGS: >
190+
--cfg NO_UI_TESTS
191+
--cfg NO_ALLOC_FAIL_TESTS
192+
-Z sanitizer=address
193+
-Dwarnings
194+
- run: |
195+
git rebase --exec \
196+
'cargo test --all-targets --target x86_64-unknown-linux-gnu' \
197+
--root
148198
env:
149-
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak -Dwarnings"
199+
RUSTFLAGS: >
200+
--cfg NO_UI_TESTS
201+
--cfg NO_ALLOC_FAIL_TESTS
202+
-Z sanitizer=leak
203+
-Dwarnings
150204
# doctests are strangely not included in --all-targets
151-
- run: git rebase --exec 'cargo test --doc --target x86_64-unknown-linux-gnu' --root
205+
- run: |
206+
git rebase --exec \
207+
'cargo test --doc --target x86_64-unknown-linux-gnu' \
208+
--root
152209
env:
153-
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak -Dwarnings"
210+
RUSTFLAGS: >
211+
--cfg NO_UI_TESTS
212+
--cfg NO_ALLOC_FAIL_TESTS
213+
-Z sanitizer=leak
214+
-Dwarnings
154215
msrv:
155216
runs-on: ubuntu-latest
156217
steps:
@@ -161,7 +222,22 @@ jobs:
161222
- uses: dtolnay/rust-toolchain@stable
162223
- run: cargo install cargo-hack
163224
- run: git config user.name "github-runner" && git config user.email "<>"
164-
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset --exclude-features unsafe-pinned --exclude-features alloc --exclude-features default --version-range 1.82.. --clean-per-version check --locked --all-targets' --exec 'cargo clean' --root
225+
- run: |
226+
echo '#!/bin/bash
227+
set -e
228+
cargo hack \
229+
--clean-per-run \
230+
--feature-powerset \
231+
--exclude-features alloc \
232+
--exclude-features unsafe-pinned \
233+
--exclude-features default \
234+
--version-range 1.82.. \
235+
--clean-per-version \
236+
check \
237+
--locked \
238+
--all-targets
239+
cargo clean' > exec.sh
240+
git rebase --exec "bash exec.sh" --root
165241
env:
166242
RUSTFLAGS: "-Dwarnings"
167243
nightly-msrv:
@@ -177,7 +253,19 @@ jobs:
177253
- run: cargo install cargo-hack
178254
- run: cargo install cargo-expand
179255
- run: git config user.name "github-runner" && git config user.email "<>"
180-
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset --version-range 1.78.. --clean-per-version check --locked --all-targets' --exec 'cargo clean' --root
256+
- run: |
257+
echo '#!/bin/bash
258+
set -e
259+
cargo hack \
260+
--clean-per-run \
261+
--feature-powerset \
262+
--version-range 1.78.. \
263+
--clean-per-version \
264+
check \
265+
--locked \
266+
--all-targets
267+
cargo clean' > exec.sh
268+
git rebase --exec "bash exec.sh" --root
181269
env:
182270
RUSTC_BOOTSTRAP: 1
183271
RUSTFLAGS: "-Dwarnings"
@@ -214,7 +302,10 @@ jobs:
214302
fetch-depth: ${{github.event.pull_request.commits}}
215303
ref: ${{github.event.pull_request.head.sha}}
216304
- run: git config user.name "github-runner" && git config user.email "<>"
217-
- run: git rebase --exec 'git log --no-merges -1 --pretty=format:%B | grep -q "^Signed-off-by:"' --root
305+
- run: |
306+
git rebase --exec \
307+
'git log --no-merges -1 --pretty=format:%B | grep -q "^Signed-off-by:"' \
308+
--root
218309
apply:
219310
runs-on: ubuntu-latest
220311
steps:
@@ -256,7 +347,10 @@ jobs:
256347
components: rust-src
257348
- run: sudo apt-get install -y linkchecker
258349
- run: git config user.name "github-runner" && git config user.email "<>"
259-
- run: git rebase --exec 'cargo doc --all-features --no-deps && linkchecker target/doc/*/*.html' --root
350+
- run: |
351+
git rebase --exec \
352+
'cargo doc --all-features --no-deps && linkchecker target/doc/*/*.html' \
353+
--root
260354
env:
261355
RUSTFLAGS: "-Dwarnings"
262356
update:

0 commit comments

Comments
 (0)