-
-
Notifications
You must be signed in to change notification settings - Fork 9
73 lines (71 loc) · 2.06 KB
/
ci_action.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
65
66
67
68
69
70
71
72
73
name: CI Action
on:
push:
branches:
- '**'
- '!master'
pull_request:
branches:
- '**'
jobs:
build:
name: Build ${{ matrix.label }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- label: macos_apple-clang
os: macos-latest
compiler: default
SHELL: bash
SEP: /
LS_CMD: ls -la
- label: ubuntu_gcc
os: ubuntu-latest
compiler: {c: gcc, cpp: g++}
SHELL: bash
SEP: /
LS_CMD: ls -la
- label: ubuntu_clang
os: ubuntu-latest
compiler: {c: clang, cpp: clang++}
SHELL: bash
SEP: /
LS_CMD: ls -la
- label: windows_msvc
os: windows-latest
compiler: default
SHELL: cmd
SEP: \
LS_CMD: dir /a
defaults:
run:
shell: ${{ matrix.SHELL }}
env:
BUILD_DIR: ${{ github.workspace }}${{ matrix.SEP }}build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: List Workspace
run: ${{matrix.LS_CMD}} ${{ github.workspace }}
- name: Customize Compilers
if: ${{ matrix.compiler!='default' }}
run: |
echo "CC=${{matrix.compiler.c}}" >> "$GITHUB_ENV"
echo "CXX=${{matrix.compiler.cpp}}" >> "$GITHUB_ENV"
- name: Compile
run: |
echo "== CMAKE VERSION =="
cmake --version
echo "== CMAKE CONFIGURE =="
cmake -B${{env.BUILD_DIR}} -DCI_TRIGGERED=1
echo "== CMAKE BUILD =="
cmake --build ${{env.BUILD_DIR}} --config Release
- name: List Build
run: ${{matrix.LS_CMD}} ${{env.BUILD_DIR}}
- name: Test
run: |
cd ${{env.BUILD_DIR}}
ctest -C Release -T test --output-on-failure
cd ${{ github.workspace }}