-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (43 loc) · 1.36 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
name: Basic CMake build
on: [push, pull_request]
env:
CMAKE_BUILD_TYPE: Release
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v3
# Select compiler and build type
- name: Configure CMake
env:
CC: ${{ matrix.compiler }}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
- name: Test
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}}
- name: Package
working-directory: ${{github.workspace}}/build
run: cpack -C ${{matrix.build_type}} -G "RPM;DEB;TGZ"
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Configure CMake
env:
CC: ${{ matrix.compiler }}
run: cmake -B ${{github.workspace}}/build
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest
- name: Package
working-directory: ${{github.workspace}}/build
run: cpack -G productbuild