2727 name : Windows
2828 steps :
2929 - name : Checkout repository
30- uses : actions/checkout@v1
30+ uses : actions/checkout@v4.0.0
3131 with :
3232 fetch-depth : 10
3333
@@ -54,14 +54,13 @@ jobs:
5454 if : runner.os == 'Windows'
5555 uses : seanmiddleditch/gha-setup-ninja@master
5656
57- # - uses: Jimver/[email protected] 58- # id: cuda-toolkit
59- # with:
60- # cuda: '11.5.1'
57+ - name : Get number of CPU cores
58+ 59+ id : cpu-cores
6160
6261 - name : Cache Build
6362 id : cache-build
64- uses : actions/cache@v3 .0.11
63+ uses : actions/cache@v4 .0.2
6564 with :
6665 path : ${{ env.CACHE_PATH }}
6766 key : ${{ runner.os }}-${{ matrix.config }}-cache
@@ -94,17 +93,19 @@ jobs:
9493
9594 - name : Build (Linux/macOS)
9695 if : runner.os != 'Windows'
97- run : cd build; make -j2; ccache --show-stats
96+ run : |
97+ cmake --build build -j ${{ steps.cpu-cores.outputs.count }}
98+ ccache --show-stats
9899
99100 - name : Build (Windows)
100101 if : runner.os == 'Windows'
101102 shell : cmd
102103 run : |
103104 call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
104- cmake --build build -j2 && ccache --show-stats
105+ cmake --build build -j ${{ steps.cpu-cores.outputs.count }} && ccache --show-stats
105106
106107 - name : Tests
107- run : cd build; ctest --verbose -j2
108+ run : cd build; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }}
108109
109110 build_cuda : # no runtime support for CUDA, so only build on Linux
110111 name : ${{ matrix.name }} CUDA (${{ matrix.config }})
@@ -121,7 +122,7 @@ jobs:
121122 name : Linux
122123 steps :
123124 - name : Checkout repository
124- uses : actions/checkout@v1
125+ uses : actions/checkout@v4.0.0
125126 with :
126127 fetch-depth : 10
127128
@@ -138,9 +139,13 @@ jobs:
138139 sub-packages : ' ["nvcc"]'
139140 method : ' network'
140141
142+ - name : Get number of CPU cores
143+ 144+ id : cpu-cores
145+
141146 - name : Cache Build
142147 id : cache-build
143- uses : actions/cache@v3 .0.11
148+ uses : actions/cache@v4 .0.2
144149 with :
145150 path : ${{ env.CACHE_PATH }}
146151 key : ${{ runner.os }}-${{ matrix.config }}-CUDA-cache
@@ -162,8 +167,6 @@ jobs:
162167 -DCMAKE_BUILD_TYPE=${{ matrix.config }}
163168
164169 - name : Build
165- run : cd build; make -j2; ccache --show-stats
166-
167- # GitHub Actions does not support CUDA, so we cannot run the tests.
168- # - name: Tests
169- # run: cd build; ctest --verbose -j2
170+ run : |
171+ cmake --build build -j ${{ steps.cpu-cores.outputs.count }}
172+ ccache --show-stats
0 commit comments