-
Notifications
You must be signed in to change notification settings - Fork 14
61 lines (50 loc) · 1.92 KB
/
ci.yml
File metadata and controls
61 lines (50 loc) · 1.92 KB
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
57
58
59
60
61
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build_type: [Debug, Release]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} (${{ matrix.build_type }})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache FetchContent dependencies
uses: actions/cache@v4
with:
path: build/_deps
key: deps-${{ runner.os }}-${{ runner.arch }}-x64-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
deps-${{ runner.os }}-${{ runner.arch }}-x64-
- name: Configure (Unix)
if: runner.os != 'Windows'
run: >
cmake -B build -S .
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DFASTMCPP_BUILD_TESTS=ON
-DFASTMCPP_BUILD_EXAMPLES=ON
- name: Configure (Windows)
if: runner.os == 'Windows'
run: |
if (Test-Path build) { Remove-Item -Recurse -Force build/CMakeCache.txt, build/CMakeFiles -ErrorAction SilentlyContinue }
cmake -B build -S . -G "Visual Studio 17 2022" -A x64 -DFASTMCPP_BUILD_TESTS=ON -DFASTMCPP_BUILD_EXAMPLES=ON
- name: Build (Unix)
if: runner.os != 'Windows'
run: cmake --build build --config ${{ matrix.build_type }} --parallel 2
- name: Build (Windows)
if: runner.os == 'Windows'
# Single-threaded build to avoid C1060 "compiler out of heap space" on GitHub's 16GB Windows runners
# Even /m:4 exhausts heap with deeply nested JSON initializers in test files
run: cmake --build build --config ${{ matrix.build_type }} -- /m:1 /p:CL_MPCount=1
- name: Test
run: ctest --test-dir build -C ${{ matrix.build_type }} --output-on-failure