-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (61 loc) · 1.62 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
57
58
59
60
61
62
63
64
name: CPET-Test
on:
push:
paths:
- '**.c'
- '**.cpp'
- '**.h'
- '**.hpp'
- '**.cmake'
- '**/CMakeLists.txt'
- '.github/workflows/build.yml'
pull_request:
paths:
- '**.c'
- '**.cpp'
- '**.h'
- '**.hpp'
- '**.cmake'
- '**/CMakeLists.txt'
- '.github/workflows/build.yml'
jobs:
Build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
# see: https://github.com/actions/virtual-environments
- {
name: "Ubuntu/18.04/Static/X64/Release",
os: ubuntu-18.04,
config: Debug,
cmake_extra_args: "-DCMAKE_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 -DENABLE_TESTING=ON",
sudocmd: "sudo",
artifact_name: "Linux",
cores: 2,
}
- {
name: "MacOSX/10.15/Static/X64/Release",
os: macos-10.15,
config: Debug,
cmake_extra_args: "-DENABLE_TESTING=ON",
sudocmd: "sudo",
artifact_name: "MacOSX",
cores: 4,
}
steps:
- uses: actions/checkout@v2
- name: Create Work Dir
run: mkdir build
- name: Configure
working-directory: ./build
run: |
cmake .. ${{ matrix.config.cmake_extra_args }} -DCMAKE_BUILD_TYPE=${{ matrix.config.config }}
- name: Build
working-directory: ./build
run: make
- name: Test
working-directory: ./build
run: ctest --parallel ${{ matrix.config.cores }}