-
-
Notifications
You must be signed in to change notification settings - Fork 9
56 lines (48 loc) · 1.6 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build & Test
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
# nothing here
jobs:
build:
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{matrix.os}}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up MSVC [Windows]
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
spectre: true
- name: Install Dependencies [macOS]
if: matrix.os == 'macos-latest'
run: |
brew install gcc@11
brew install ninja
- name: Install Dependencies [Linux]
if: matrix.os == 'ubuntu-latest'
run: sudo apt update && sudo apt install -y ninja-build
- name: Configure CMake [Windows / Linux]
if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest'
run: cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSOURCEPP_BUILD_TESTS=ON
- name: Configure CMake [macOS]
if: matrix.os == 'macos-latest'
run: |
export PATH=/opt/homebrew/bin:$PATH
cmake -G "Ninja" -B build -DCMAKE_C_COMPILER="gcc-11" -DCMAKE_CXX_COMPILER="g++-11" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSOURCEPP_BUILD_TESTS=ON
- name: Build
run: cmake --build build --config ${{matrix.build_type}}
- name: Test
working-directory: '${{github.workspace}}/build'
run: ctest