Skip to content

Commit ba3a0e3

Browse files
committed
[ci] Adapt compilation tests to support Windows
1 parent bf3c13f commit ba3a0e3

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ jobs:
8383
- name: Determine number of cpus on Windows
8484
if: startsWith(matrix.os, 'windows')
8585
run: echo "num_cpus=$env:NUMBER_OF_PROCESSORS" >> $env:GITHUB_ENV
86+
87+
- name: Determine number of compilation test jobs on macOS and Linux
88+
if: ${{ !startsWith(matrix.os, 'windows') }}
89+
shell: bash
90+
run: echo "num_comp_tests=$((${{env.num_cpus}} * 2))" >> $GITHUB_ENV
91+
92+
- name: Determine number of compilation test jobs on Windows
93+
if: startsWith(matrix.os, 'windows')
94+
shell: bash
95+
run: echo "num_comp_tests=1" >> $GITHUB_ENV
96+
8697
- name: Determine compiler flag
8798
if: ${{matrix.compiler}}
8899
run: echo "CXX=${{matrix.compiler}}" >> $GITHUB_ENV
@@ -97,10 +108,8 @@ jobs:
97108

98109
- name: Test
99110
working-directory: ${{github.workspace}}/build
100-
run: cmake --build . --config ${BUILD_TYPE} --target test
101-
ARGS=-j$((${num_cpus} * 2)) # don't pass --parallel, which would affect compilation tests,
102-
# but do run twice as many compilation tests as the number of
103-
# available threads
111+
run: cmake --build . --config ${{env.BUILD_TYPE}} --target test
112+
ARGS=-j${{env.num_comp_tests}} # don't pass --parallel, which would affect compilation tests
104113

105114
- name: Produce coverage reports
106115
if: contains(matrix.extra_build_flags, 'coverage')

0 commit comments

Comments
 (0)