Skip to content

Commit

Permalink
CI: Parallelize compilation for faster testing
Browse files Browse the repository at this point in the history
Reduce  compilation time for CI by adding the -j$(nproc) flag to make.
This speeds up host-x86 tests from 2m3s to 1m26s and host-arm64 tests
from 11m0s to 8m34s on my GitHub Action workflows.
  • Loading branch information
visitorckw committed May 4, 2024
1 parent e575da4 commit 23f6cd2
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,30 @@ jobs:
run: make
- name: check + tests
run: |
make check
make tests
make misalign
make tool
make check -j$(nproc)
make tests -j$(nproc)
make misalign -j$(nproc)
make tool -j$(nproc)
- name: diverse configurations
run: |
make distclean && make ENABLE_EXT_M=0 check
make distclean && make ENABLE_EXT_A=0 check
make distclean && make ENABLE_EXT_F=0 check
make distclean && make ENABLE_EXT_C=0 check
make distclean && make ENABLE_SDL=0 check
make distclean && make ENABLE_EXT_M=0 check -j$(nproc)
make distclean && make ENABLE_EXT_A=0 check -j$(nproc)
make distclean && make ENABLE_EXT_F=0 check -j$(nproc)
make distclean && make ENABLE_EXT_C=0 check -j$(nproc)
make distclean && make ENABLE_SDL=0 check -j$(nproc)
- name: gdbstub test
run: |
make distclean ENABLE_GDBSTUB=1 gdbstub-test
- name: JIT test
run: |
make clean && make ENABLE_JIT=1 check
make clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check
make clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check
make clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check
make clean && make ENABLE_JIT=1 check -j$(nproc)
make clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check -j$(nproc)
make clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check -j$(nproc)
make clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check -j$(nproc)
- name: undefined behavior test
run: |
make clean && make ENABLE_UBSAN=1 check
make clean && make ENABLE_JIT=1 ENABLE_UBSAN=1 check
make clean && make ENABLE_UBSAN=1 check -j$(nproc)
make clean && make ENABLE_JIT=1 ENABLE_UBSAN=1 check -j$(nproc)
host-arm64:
needs: [detect-code-related-file-changes]
Expand All @@ -97,12 +97,12 @@ jobs:
git config --global --add safe.directory ${{ github.workspace }}/src/mini-gdbstub
# Append custom commands here
run: |
make
make check
make clean && make ENABLE_JIT=1 check
make clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check
make clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check
make clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check
make -j$(nproc)
make check -j$(nproc)
make clean && make ENABLE_JIT=1 check -j$(nproc)
make clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check -j$(nproc)
make clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check -j$(nproc)
make clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check -j$(nproc)
coding-style:
needs: [detect-code-related-file-changes]
Expand Down

0 comments on commit 23f6cd2

Please # to comment.