27
27
name : Windows
28
28
steps :
29
29
- name : Checkout repository
30
- uses : actions/checkout@v1
30
+ uses : actions/checkout@v4.0.0
31
31
with :
32
32
fetch-depth : 10
33
33
@@ -54,14 +54,13 @@ jobs:
54
54
if : runner.os == 'Windows'
55
55
uses : seanmiddleditch/gha-setup-ninja@master
56
56
57
- # - uses: Jimver/cuda-toolkit@v0.2.5
58
- # id: cuda-toolkit
59
- # with:
60
- # cuda: '11.5.1'
57
+ - name : Get number of CPU cores
58
+ uses : SimenB/github-actions-cpu-cores@v2.0.0
59
+ id : cpu-cores
61
60
62
61
- name : Cache Build
63
62
id : cache-build
64
- uses : actions/cache@v3 .0.11
63
+ uses : actions/cache@v4 .0.2
65
64
with :
66
65
path : ${{ env.CACHE_PATH }}
67
66
key : ${{ runner.os }}-${{ matrix.config }}-cache
@@ -94,17 +93,19 @@ jobs:
94
93
95
94
- name : Build (Linux/macOS)
96
95
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
98
99
99
100
- name : Build (Windows)
100
101
if : runner.os == 'Windows'
101
102
shell : cmd
102
103
run : |
103
104
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
105
106
106
107
- name : Tests
107
- run : cd build; ctest --verbose -j2
108
+ run : cd build; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }}
108
109
109
110
build_cuda : # no runtime support for CUDA, so only build on Linux
110
111
name : ${{ matrix.name }} CUDA (${{ matrix.config }})
@@ -121,7 +122,7 @@ jobs:
121
122
name : Linux
122
123
steps :
123
124
- name : Checkout repository
124
- uses : actions/checkout@v1
125
+ uses : actions/checkout@v4.0.0
125
126
with :
126
127
fetch-depth : 10
127
128
@@ -138,9 +139,13 @@ jobs:
138
139
sub-packages : ' ["nvcc"]'
139
140
method : ' network'
140
141
142
+ - name : Get number of CPU cores
143
+ uses : SimenB/github-actions-cpu-cores@v2.0.0
144
+ id : cpu-cores
145
+
141
146
- name : Cache Build
142
147
id : cache-build
143
- uses : actions/cache@v3 .0.11
148
+ uses : actions/cache@v4 .0.2
144
149
with :
145
150
path : ${{ env.CACHE_PATH }}
146
151
key : ${{ runner.os }}-${{ matrix.config }}-CUDA-cache
@@ -162,8 +167,6 @@ jobs:
162
167
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
163
168
164
169
- 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