forked from WG21-SG14/SG14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] Set up a GitHub Actions workflow for CI
- Loading branch information
1 parent
574497c
commit 3f15da7
Showing
3 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build and run tests | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
# 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. | ||
fail-fast: true | ||
|
||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
build_type: [Debug, RelWithDebInfo, Release] | ||
cpp_compiler: [g++, clang++] | ||
cpp_standard: [14, 17, 20, 23] | ||
exclude: | ||
- os: windows-latest | ||
cpp_compiler: clang++ | ||
- os: windows-latest | ||
cpp_compiler: g++ | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Google Test (Linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get install libgtest-dev | ||
# Configure CMake in a 'build' subdirectory. | ||
# `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
# | ||
- name: Build and Test | ||
run: | | ||
cmake -S ${{ github.workspace }} -B ${{ github.workspace }}/build \ | ||
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \ | ||
-DCMAKE_CXX_STANDARD=${{ matrix.cpp_standard }} \ | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
cd ${{ github.workspace }}/build | ||
make | ||
./bin/utest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters