Skip to content

Commit 9bc557e

Browse files
authored
Merge pull request #118 from Rust-for-Linux/ci-simplify
CI: simplify for readability
2 parents 5bb52ee + c570b35 commit 9bc557e

File tree

1 file changed

+48
-25
lines changed

1 file changed

+48
-25
lines changed

.github/workflows/ci.yaml

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -156,35 +156,58 @@ jobs:
156156
# Run
157157
- run: ${{ env.BUILD_DIR }}usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
158158

159-
- run: qemu-system-${{ env.QEMU_ARCH }} -kernel ${{ env.BUILD_DIR }}${{ env.IMAGE_PATH }} -initrd qemu-initramfs.img -M ${{ env.QEMU_MACHINE }} -cpu ${{ env.QEMU_CPU }} -smp 2 -nographic -no-reboot -append '${{ env.QEMU_APPEND }} rust_example.my_i32=123321 rust_example.my_str=🦀mod rust_example_2.my_i32=234432' | tee qemu-stdout.log
159+
- run: |
160+
qemu-system-${{ env.QEMU_ARCH }} \
161+
-kernel ${{ env.BUILD_DIR }}${{ env.IMAGE_PATH }} \
162+
-initrd qemu-initramfs.img \
163+
-M ${{ env.QEMU_MACHINE }} \
164+
-cpu ${{ env.QEMU_CPU }} \
165+
-smp 2 \
166+
-nographic \
167+
-no-reboot \
168+
-append '${{ env.QEMU_APPEND }} rust_example.my_i32=123321 rust_example.my_str=🦀mod rust_example_2.my_i32=234432' \
169+
| sed s:$'\r'$:: \
170+
| tee qemu-stdout.log
160171
161172
# Check
162-
- run: grep -F '] Rust Example (init)' qemu-stdout.log
163-
- run: grep -F '] [2] Rust Example (init)' qemu-stdout.log
164-
- run: grep -F '] [3] Rust Example (init)' qemu-stdout.log
165-
- run: grep -F '] [4] Rust Example (init)' qemu-stdout.log
166-
167-
- run: "grep -F '] my_i32: 123321' qemu-stdout.log"
168-
- run: "grep -F '] [2] my_i32: 234432' qemu-stdout.log"
169-
- run: "grep -F '] [3] my_i32: 345543' qemu-stdout.log"
170-
- run: "grep -F '] [4] my_i32: 456654' qemu-stdout.log"
171-
172-
- run: "grep -F '] my_usize: 42' qemu-stdout.log"
173-
- run: "grep -F '] [2] my_usize: 42' qemu-stdout.log"
174-
- run: "grep -F '] [3] my_usize: 42' qemu-stdout.log"
175-
- run: "grep -F '] [4] my_usize: 84' qemu-stdout.log"
176-
177-
- run: "grep '\\] my_str: 🦀mod\\s*$' qemu-stdout.log"
178-
- run: "grep '\\] \\[2\\] my_str: default str val\\s*$' qemu-stdout.log"
179-
- run: "grep '\\] \\[3\\] my_str: 🦀mod\\s*$' qemu-stdout.log"
180-
- run: "grep '\\] \\[4\\] my_str: default str val\\s*$' qemu-stdout.log"
181-
182-
- run: grep -F '] [3] Rust Example (exit)' qemu-stdout.log
183-
- run: grep -F '] [4] Rust Example (exit)' qemu-stdout.log
173+
- run: |
174+
grep '] Rust Example (init)$' qemu-stdout.log
175+
grep '] \[2] Rust Example (init)$' qemu-stdout.log
176+
grep '] \[3] Rust Example (init)$' qemu-stdout.log
177+
grep '] \[4] Rust Example (init)$' qemu-stdout.log
178+
179+
grep '] my_i32: 123321$' qemu-stdout.log
180+
grep '] \[2] my_i32: 234432$' qemu-stdout.log
181+
grep '] \[3] my_i32: 345543$' qemu-stdout.log
182+
grep '] \[4] my_i32: 456654$' qemu-stdout.log
183+
184+
grep '] my_usize: 42$' qemu-stdout.log
185+
grep '] \[2] my_usize: 42$' qemu-stdout.log
186+
grep '] \[3] my_usize: 42$' qemu-stdout.log
187+
grep '] \[4] my_usize: 84$' qemu-stdout.log
188+
189+
grep '] my_str: 🦀mod$' qemu-stdout.log
190+
grep '] \[2] my_str: default str val$' qemu-stdout.log
191+
grep '] \[3] my_str: 🦀mod$' qemu-stdout.log
192+
grep '] \[4] my_str: default str val$' qemu-stdout.log
193+
194+
grep '] \[3] Rust Example (exit)$' qemu-stdout.log
195+
grep '] \[4] Rust Example (exit)$' qemu-stdout.log
184196
185197
# Report
186-
- run: ls -l ${{ env.BUILD_DIR }}drivers/char/rust_example.o ${{ env.BUILD_DIR }}drivers/char/rust_example_3.ko ${{ env.BUILD_DIR }}rust/*.o ${{ env.BUILD_DIR }}vmlinux ${{ env.BUILD_DIR }}${{ env.IMAGE_PATH }}
187-
- run: size ${{ env.BUILD_DIR }}drivers/char/rust_example.o ${{ env.BUILD_DIR }}drivers/char/rust_example_3.ko ${{ env.BUILD_DIR }}rust/*.o ${{ env.BUILD_DIR }}vmlinux
198+
- run: |
199+
ls -l \
200+
${{ env.BUILD_DIR }}drivers/char/rust_example.o \
201+
${{ env.BUILD_DIR }}drivers/char/rust_example_3.ko \
202+
${{ env.BUILD_DIR }}rust/*.o \
203+
${{ env.BUILD_DIR }}vmlinux \
204+
${{ env.BUILD_DIR }}${{ env.IMAGE_PATH }}
205+
206+
size \
207+
${{ env.BUILD_DIR }}drivers/char/rust_example.o \
208+
${{ env.BUILD_DIR }}drivers/char/rust_example_3.ko \
209+
${{ env.BUILD_DIR }}rust/*.o \
210+
${{ env.BUILD_DIR }}vmlinux
188211
189212
# Clippy
190213
- run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 CLIPPY=1

0 commit comments

Comments
 (0)