Skip to content

Commit 472ef6b

Browse files
Update cmake-multi-platform.yml
1 parent d297c36 commit 472ef6b

1 file changed

Lines changed: 24 additions & 39 deletions

File tree

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
2-
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
31
name: CMake on multiple platforms
42

53
on:
64
push:
75
branches:
8-
- main
9-
- adaptiveDt
6+
- main
7+
- adaptiveDt
108
pull_request:
119
branches: [ "main" ]
1210

@@ -15,15 +13,7 @@ jobs:
1513
runs-on: ${{ matrix.os }}
1614

1715
strategy:
18-
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
1916
fail-fast: false
20-
21-
# Set up a matrix to run the following 3 configurations:
22-
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
23-
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
24-
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
25-
#
26-
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
2717
matrix:
2818
os: [ubuntu-latest, windows-latest]
2919
build_type: [Release]
@@ -47,34 +37,29 @@ jobs:
4737
c_compiler: cl
4838

4939
steps:
50-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v4
41+
42+
- name: Install OpenMP (Ubuntu only)
43+
if: matrix.os == 'ubuntu-latest'
44+
run: sudo apt-get update && sudo apt-get install -y libomp-dev
5145

52-
- name: Set reusable strings
53-
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
54-
id: strings
55-
shell: bash
56-
run: |
57-
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
58-
- name: Install OpenMP (Ubuntu)
59-
if matrix.os == 'ubuntu.latest'
60-
run: sudo apt-get update && sudo apt-get install -y libomp-dev
46+
- name: Set reusable strings
47+
id: strings
48+
shell: bash
49+
run: |
50+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
6151
62-
- name: Configure CMake
63-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
64-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
65-
run: >
66-
cmake -B ${{ steps.strings.outputs.build-output-dir }}
67-
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
68-
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
69-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
70-
-S ${{ github.workspace }}
52+
- name: Configure CMake
53+
run: >
54+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
55+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
56+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
57+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
58+
-S ${{ github.workspace }}
7159
72-
- name: Build
73-
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
74-
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
60+
- name: Build
61+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
7562

76-
- name: Test
77-
working-directory: ${{ steps.strings.outputs.build-output-dir }}
78-
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
79-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
80-
run: ctest --build-config ${{ matrix.build_type }}
63+
- name: Test
64+
working-directory: ${{ steps.strings.outputs.build-output-dir }}
65+
run: ctest --build-config ${{ matrix.build_type }}

0 commit comments

Comments
 (0)