Skip to content

Commit f81ca05

Browse files
committed
update workflow.yml
1 parent 494aa8a commit f81ca05

1 file changed

Lines changed: 30 additions & 23 deletions

File tree

.github/workflows/cmake-multi-platform.yml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -96,43 +96,50 @@ jobs:
9696
# Configure CMake
9797
#################################
9898
- name: Configure CMake
99-
shell: bash
99+
shell: pwsh
100100
run: |
101-
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
102-
cmake -B ${{ steps.strings.outputs.build-output-dir }} \
103-
-G "Unix Makefiles" \
104-
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
105-
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
106-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
107-
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
108-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
109-
-S ${{ github.workspace }}
110-
else
111-
cmake -B "${{ steps.strings.outputs.build-output-dir }}" -G "MinGW Makefiles" -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S "${{ github.workspace }}"
112-
fi
101+
if ($env:RUNNER_OS -eq "Linux") {
102+
cmake -B "${{ steps.strings.outputs.build-output-dir }}" `
103+
-G "Unix Makefiles" `
104+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} `
105+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} `
106+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
107+
-DCMAKE_C_COMPILER_LAUNCHER=ccache `
108+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache `
109+
-S "${{ github.workspace }}"
110+
} else {
111+
cmake -B "${{ steps.strings.outputs.build-output-dir }}" `
112+
-G "MinGW Makefiles" `
113+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} `
114+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} `
115+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
116+
-S "${{ github.workspace }}"
117+
}
113118
114119
#################################
115120
# Build project
116121
#################################
117122
- name: Build
123+
shell: pwsh
118124
run: |
119-
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
120-
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} -- -j$(nproc)
121-
else
122-
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} -- /m
123-
fi
125+
if ($env:RUNNER_OS -eq "Linux") {
126+
cmake --build "${{ steps.strings.outputs.build-output-dir }}" --config ${{ matrix.build_type }} -- -j$(nproc)
127+
} else {
128+
cmake --build "${{ steps.strings.outputs.build-output-dir }}" --config ${{ matrix.build_type }} -- /m
129+
}
124130
125131
#################################
126132
# Run tests
127133
#################################
128134
- name: Run tests
135+
shell: pwsh
129136
working-directory: ${{ steps.strings.outputs.build-output-dir }}
130137
run: |
131-
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
132-
xvfb-run -a ctest --output-on-failure --build-config ${{ matrix.build_type }}
133-
else
134-
ctest --output-on-failure --build-config ${{ matrix.build_type }}
135-
fi
138+
if ($env:RUNNER_OS -eq "Linux") {
139+
xvfb-run -a ctest --output-on-failure --build-config ${{ matrix.build_type }}
140+
} else {
141+
ctest --output-on-failure --build-config ${{ matrix.build_type }}
142+
}
136143
137144
#################################
138145
# Upload artifacts

0 commit comments

Comments
 (0)