Skip to content

Commit c69af25

Browse files
authored
Create pr_validation.yml
1 parent a6f6cff commit c69af25

1 file changed

Lines changed: 142 additions & 0 deletions

File tree

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
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
3+
name: CMake on multiple platforms
4+
5+
on:
6+
push:
7+
branches: [ "main" ]
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
jobs:
12+
macos:
13+
runs-on: macos-latest
14+
15+
strategy:
16+
fail-fast: false
17+
18+
matrix:
19+
build_type: [Release, Debug]
20+
c_compiler: [clang]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set reusable strings
26+
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
27+
id: strings
28+
shell: bash
29+
run: |
30+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
31+
32+
- name: Install vcpkg
33+
run: |
34+
cd ${{ github.workspace }}
35+
git clone https://github.com/microsoft/vcpkg.git
36+
/bin/sh -c ./vcpkg/bootstrap-vcpkg.sh
37+
38+
- name: Configure CMake
39+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
40+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
41+
run: >
42+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
43+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
44+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
45+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
46+
-S ${{ github.workspace }}
47+
-DWOWPKG_USE_DEVELOPMENT_PATHS:option=on
48+
-DWOWPKG_ENABLE_SANITIZERS:option=on
49+
-DWOWPKG_ENABLE_TESTS:option=on
50+
-DWOWPKG_ENABLE_TESTS_INTEGRATION:option=off
51+
52+
53+
- name: Build
54+
# 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).
55+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
56+
57+
- name: Test
58+
working-directory: ${{ steps.strings.outputs.build-output-dir }}
59+
# 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).
60+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
61+
run: ctest --build-config ${{ matrix.build_type }}
62+
63+
64+
# build:
65+
# runs-on: ${{ matrix.os }}
66+
67+
# strategy:
68+
# # 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.
69+
# fail-fast: false
70+
71+
# # Set up a matrix to run the following 3 configurations:
72+
# # 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
73+
# # 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
74+
# # 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
75+
# #
76+
# # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
77+
# matrix:
78+
# os: [ubuntu-latest, windows-latest, macos-latest]
79+
# build_type: [Release, Debug]
80+
# c_compiler: [gcc, clang, cl]
81+
# include:
82+
# - os: windows-latest
83+
# c_compiler: cl
84+
# cpp_compiler: cl
85+
# - os: ubuntu-latest
86+
# c_compiler: gcc
87+
# cpp_compiler: g++
88+
# - os: ubuntu-latest
89+
# c_compiler: clang
90+
# cpp_compiler: clang++
91+
# exclude:
92+
# - os: windows-latest
93+
# c_compiler: gcc
94+
# - os: windows-latest
95+
# c_compiler: clang
96+
# - os: ubuntu-latest
97+
# c_compiler: cl
98+
# - os: macos-latest
99+
# c_compiler: cl
100+
# - os: macos-latest
101+
# c_compiler: gcc
102+
103+
# steps:
104+
# - uses: actions/checkout@v4
105+
106+
# - name: Set reusable strings
107+
# # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
108+
# id: strings
109+
# shell: bash
110+
# run: |
111+
# echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
112+
113+
# - name: Install vcpkg
114+
# run: |
115+
# cd ${{ github.workspace }}
116+
# git clone https://github.com/microsoft/vcpkg.git
117+
# /bin/sh -c ./vcpkg/bootstrap-vcpkg.sh
118+
119+
# - name: Configure CMake
120+
# # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
121+
# # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
122+
# run: >
123+
# cmake -B ${{ steps.strings.outputs.build-output-dir }}
124+
# -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
125+
# -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
126+
# -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
127+
# -S ${{ github.workspace }}
128+
# -DWOWPKG_USE_DEVELOPMENT_PATHS:option=on
129+
# -DWOWPKG_ENABLE_SANITIZERS:option=on
130+
# -DWOWPKG_ENABLE_TESTS:option=on
131+
# -DWOWPKG_ENABLE_TESTS_INTEGRATION:option=off
132+
133+
134+
# - name: Build
135+
# # 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).
136+
# run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
137+
138+
# - name: Test
139+
# working-directory: ${{ steps.strings.outputs.build-output-dir }}
140+
# # 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).
141+
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
142+
# run: ctest --build-config ${{ matrix.build_type }}

0 commit comments

Comments
 (0)