-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (56 loc) · 1.66 KB
/
build_and_test.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
57
58
59
60
61
62
63
name: build & test (clang, gcc, MSVC)
on:
workflow_dispatch:
push:
branches: [ "master", "dev" ]
paths-ignore:
- '**.md'
pull_request:
branches: [ "master", "dev" ]
paths-ignore:
- '**.md'
jobs:
build:
name: ${{ matrix.config.name }} (nameof = ${{ matrix.use_nameof }})
runs-on: ${{ matrix.config.os }}
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
strategy:
fail-fast: false
matrix:
use_nameof: ["ON", "OFF"]
config:
- {
name: "Ubuntu Latest gcc",
os: ubuntu-latest,
cmake-preset: "gcc-release"
}
- {
name: "Ubuntu Latest clang",
os: ubuntu-latest,
cmake-preset: "clang-release"
}
- {
name: "Windows Latest MSVC",
os: windows-latest,
cmake-preset: "msvc-release"
}
steps:
- name: Install ninja (Windows)
if: matrix.config.os == 'windows-latest'
run: choco install ninja
- name: Install ninja (Linux)
if: matrix.config.os == 'ubuntu-latest'
run: sudo apt install ninja-build
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: hendrikmuhs/[email protected]
- uses: ilammy/msvc-dev-cmd@v1
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DENABLE_TESTS=ON -DENABLE_EXAMPLES=ON -DCMDLIME_USE_NAMEOF=${{ matrix.use_nameof }} --preset="${{ matrix.config.cmake-preset }}"
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest