77 branches :
88 - master
99 tags : ' *'
10+
11+ # avoid wasted runs
12+ concurrency :
13+ group : ${{ github.workflow }}-${{ github.ref }}
14+ cancel-in-progress : true
15+
1016jobs :
1117 test-unix :
1218 runs-on : ${{ matrix.os }}
@@ -17,11 +23,28 @@ jobs:
1723 - ubuntu-latest
1824 - macos-latest
1925 steps :
20- - uses : actions/checkout@v6
21- - run : make
22- - run : make test
26+ - &git-checkout
27+ name : Checkout Openlibm
28+ uses : actions/checkout@v6
29+ - &count-cpu
30+ name : Count CPU cores
31+ uses : ./.github/workflows/composite-nproc
32+ - &make-build
33+ name : Build with GNU Make
34+ run : make -j${CMAKE_BUILD_PARALLEL_LEVEL}
35+ - &make-test
36+ name : Test with GNU Make
37+ run : make test -j${CTEST_PARALLEL_LEVEL}
38+ - &cmake-build
39+ name : Build with CMake
40+ run : cmake -Bbuild && cmake --build build
41+ - &ctest
42+ name : Test with CTest
43+ run : ctest --test-dir build --output-on-failure
2344 windows :
2445 runs-on : windows-latest
46+ env :
47+ CMAKE_GENERATOR : " MinGW Makefiles"
2548 strategy :
2649 fail-fast : false
2750 matrix :
@@ -34,18 +57,21 @@ jobs:
3457 run :
3558 shell : msys2 {0}
3659 steps :
37- - uses : actions/checkout@v6
60+ - *git-checkout
61+ - *count-cpu
3862 - name : Set up the desired MSYS2 environment
3963 uses : msys2/setup-msys2@v2
4064 with :
4165 msystem : ${{matrix.sys}}
42- install : base-devel mingw-w64-${{matrix.env}}-toolchain
43- - run : make
44- - run : make test
66+ install : base-devel cmake make mingw-w64-${{matrix.env}}-toolchain
67+ - *make-build
68+ - *make-test
69+ - *cmake-build
70+ - *ctest
4571 code-coverage-old :
4672 runs-on : ubuntu-latest
4773 steps :
48- - uses : actions/ checkout@v6
74+ - *git- checkout
4975 - name : Setup LCOV
5076 uses : hrishikesh-kadam/setup-lcov@v1
5177 - name : Build and Run tests
@@ -62,20 +88,20 @@ jobs:
6288 code-coverage :
6389 runs-on : ubuntu-latest
6490 steps :
65- - name : Checkout Openlibm
66- uses : actions/checkout@v6
91+ - *git-checkout
6792 - name : Checkout Openlibm-test
6893 uses : actions/checkout@v6
6994 with :
7095 repository : ' JuliaMath/openlibm-test'
7196 path : ' openlibm-test'
7297 - name : Setup LCOV
7398 uses : hrishikesh-kadam/setup-lcov@v1
99+ - *count-cpu
74100 - name : Build Openlibm
75- run : make -j`nproc` CODE_COVERAGE=1
101+ run : make -j${CMAKE_BUILD_PARALLEL_LEVEL} CODE_COVERAGE=1
76102 - name : Run Test
77103 run : |
78- make -j`nproc` -C openlibm-test \
104+ make -j${CTEST_PARALLEL_LEVEL} -C openlibm-test \
79105 USE_OPENLIBM=1 OPENLIBM_HOME="$(pwd)" \
80106 SKIP_FP_EXCEPT_TEST=1 \
81107 - name : Show Test Result
0 commit comments