Skip to content

Commit 6d45959

Browse files
authored
Merge pull request #424 from visitorckw/optimize-ci-efficiency
CI: Parallelize compilation for faster testing
2 parents 5b1a119 + 432caa9 commit 6d45959

File tree

2 files changed

+24
-31
lines changed

2 files changed

+24
-31
lines changed

.ci/riscv-tests.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,4 @@ set -x
1010
export PATH=`pwd`/toolchain/riscv/bin:$PATH
1111

1212
make clean
13-
make arch-test RISCV_DEVICE=I || exit 1
14-
make arch-test RISCV_DEVICE=IM || exit 1
15-
make arch-test RISCV_DEVICE=IC || exit 1
16-
make arch-test RISCV_DEVICE=FCZicsr || exit 1
17-
make arch-test RISCV_DEVICE=IZifencei || exit 1
18-
make arch-test RISCV_DEVICE=IZicsr || exit 1
19-
make arch-test RISCV_DEVICE=FZicsr || exit 1
20-
make arch-test RISCV_DEVICE=IMA || exit 1
13+
make arch-test RISCV_DEVICE=IMAFCZicsrZifencei || exit 1

.github/workflows/main.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,30 @@ jobs:
4949
run: make
5050
- name: check + tests
5151
run: |
52-
make check
53-
make tests
54-
make misalign
55-
make tool
52+
make check -j$(nproc)
53+
make tests -j$(nproc)
54+
make misalign -j$(nproc)
55+
make tool -j$(nproc)
5656
- name: diverse configurations
5757
run: |
58-
make distclean ENABLE_EXT_M=0 check
59-
make distclean ENABLE_EXT_A=0 check
60-
make distclean ENABLE_EXT_F=0 check
61-
make distclean ENABLE_EXT_C=0 check
62-
make distclean ENABLE_SDL=0 check
58+
make distclean && make ENABLE_EXT_M=0 check -j$(nproc)
59+
make distclean && make ENABLE_EXT_A=0 check -j$(nproc)
60+
make distclean && make ENABLE_EXT_F=0 check -j$(nproc)
61+
make distclean && make ENABLE_EXT_C=0 check -j$(nproc)
62+
make distclean && make ENABLE_SDL=0 check -j$(nproc)
6363
- name: gdbstub test
6464
run: |
6565
make distclean ENABLE_GDBSTUB=1 gdbstub-test
6666
- name: JIT test
6767
run: |
68-
make ENABLE_JIT=1 clean check
69-
make ENABLE_EXT_A=0 ENABLE_JIT=1 clean check
70-
make ENABLE_EXT_F=0 ENABLE_JIT=1 clean check
71-
make ENABLE_EXT_C=0 ENABLE_JIT=1 clean check
68+
make clean && make ENABLE_JIT=1 check -j$(nproc)
69+
make clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check -j$(nproc)
70+
make clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check -j$(nproc)
71+
make clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check -j$(nproc)
7272
- name: undefined behavior test
7373
run: |
74-
make ENABLE_UBSAN=1 clean check
75-
make ENABLE_JIT=1 ENABLE_UBSAN=1 clean check
74+
make clean && make ENABLE_UBSAN=1 check -j$(nproc)
75+
make clean && make ENABLE_JIT=1 ENABLE_UBSAN=1 check -j$(nproc)
7676
7777
host-arm64:
7878
needs: [detect-code-related-file-changes]
@@ -97,12 +97,12 @@ jobs:
9797
git config --global --add safe.directory ${{ github.workspace }}/src/mini-gdbstub
9898
# Append custom commands here
9999
run: |
100-
make
101-
make check
102-
make ENABLE_JIT=1 clean check
103-
make ENABLE_EXT_A=0 ENABLE_JIT=1 clean check
104-
make ENABLE_EXT_F=0 ENABLE_JIT=1 clean check
105-
make ENABLE_EXT_C=0 ENABLE_JIT=1 clean check
100+
make -j$(nproc)
101+
make check -j$(nproc)
102+
make clean && make ENABLE_JIT=1 check -j$(nproc)
103+
make clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check -j$(nproc)
104+
make clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check -j$(nproc)
105+
make clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check -j$(nproc)
106106
107107
coding-style:
108108
needs: [detect-code-related-file-changes]
@@ -130,9 +130,9 @@ jobs:
130130
sudo apt-get install -q -y clang clang-tools libsdl2-dev libsdl2-mixer-dev
131131
shell: bash
132132
- name: run scan-build without JIT
133-
run: make clean && make distclean && scan-build -v -o ~/scan-build --status-bugs --use-cc=clang --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=0
133+
run: make distclean && scan-build -v -o ~/scan-build --status-bugs --use-cc=clang --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=0
134134
- name: run scan-build with JIT
135-
run: make clean && make distclean && scan-build -v -o ~/scan-build --status-bugs --use-cc=clang --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=1
135+
run: make distclean && scan-build -v -o ~/scan-build --status-bugs --use-cc=clang --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=1
136136

137137
compliance-test:
138138
needs: [detect-code-related-file-changes]

0 commit comments

Comments
 (0)