@@ -25,12 +25,29 @@ jobs:
2525 - macos-latest
2626 - macos-15-intel
2727 steps :
28- - uses : actions/checkout@v7
29- - run : make -j$(getconf _NPROCESSORS_ONLN)
30- - run : make test
28+ - &git-checkout
29+ name : Checkout Openlibm
30+ uses : actions/checkout@v7
31+ - &count-cpu
32+ name : Count CPU cores
33+ uses : ./.github/workflows/composite-nproc
34+ - &make-build
35+ name : Build with GNU Make
36+ run : make -j${CMAKE_BUILD_PARALLEL_LEVEL}
37+ - &make-test
38+ name : Test with GNU Make
39+ run : make test -j${CTEST_PARALLEL_LEVEL}
40+ - &cmake-build
41+ name : Build with CMake
42+ run : cmake -Bbuild && cmake --build build
43+ - &ctest
44+ name : Test with CTest
45+ run : ctest --test-dir build --output-on-failure
3146 windows :
3247 runs-on : ${{ matrix.os }}
3348 timeout-minutes : 10
49+ env :
50+ CMAKE_GENERATOR : " MinGW Makefiles"
3451 strategy :
3552 fail-fast : false
3653 matrix :
@@ -44,32 +61,35 @@ jobs:
4461 run :
4562 shell : msys2 {0}
4663 steps :
47- - uses : actions/checkout@v7
64+ - *git-checkout
65+ - *count-cpu
4866 - name : Set up the desired MSYS2 environment
4967 uses : msys2/setup-msys2@v2
5068 with :
5169 msystem : ${{matrix.sys}}
52- install : base-devel mingw-w64-${{matrix.env}}-toolchain
53- - run : make -j$(nproc)
54- - run : make test
70+ install : base-devel mingw-w64-${{ matrix.env }}-cmake mingw-w64-${{ matrix.env }}-make mingw-w64-${{matrix.env}}-toolchain
71+ - *make-build
72+ - *make-test
73+ - *cmake-build
74+ - *ctest
5575 code-coverage :
5676 runs-on : ubuntu-latest
5777 timeout-minutes : 10
5878 steps :
59- - name : Checkout Openlibm
60- uses : actions/checkout@v7
79+ - *git-checkout
6180 - name : Checkout Openlibm-test
6281 uses : actions/checkout@v7
6382 with :
6483 repository : ' JuliaMath/openlibm-test'
6584 path : ' openlibm-test'
6685 - name : Setup LCOV
6786 uses : hrishikesh-kadam/setup-lcov@v1
87+ - *count-cpu
6888 - name : Build Openlibm
69- run : make -j$(nproc) CODE_COVERAGE=1
89+ run : make -j${CMAKE_BUILD_PARALLEL_LEVEL} CODE_COVERAGE=1
7090 - name : Run Test
7191 run : |
72- make -j$(nproc) -C openlibm-test \
92+ make -j${CTEST_PARALLEL_LEVEL} -C openlibm-test \
7393 USE_OPENLIBM=1 OPENLIBM_HOME="$(pwd)" \
7494 SKIP_FP_EXCEPT_TEST=1
7595 - name : Show Test Result
0 commit comments