-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (74 loc) · 2.11 KB
/
build-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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Build & Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
debug-build-and-test:
name: Debug Build & Test ${{ matrix.cxx }}
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') }}
strategy:
matrix:
os: ["ubuntu-22.04"]
cc: ["gcc-11"]
cxx: ["g++-11"]
include:
- os: "ubuntu-22.04"
cc: "clang-14"
cxx: "clang++-14"
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v3
- name: Install deps
run: sudo apt install -y lcov
- name: Build
run: bash scripts/build-debug.sh
# script builds, runs tests, and generates coverage info
- name: Generate test coverage
if: ${{ !contains(matrix.cxx, 'clang') }}
run: bash scripts/run-coverage.sh
- name: Upload coverage to Coveralls
if: ${{ !contains(matrix.cxx, 'clang') }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./build/lcov.info
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
debug: true
release-build-test:
name: Relase Build & Test ${{ matrix.cxx }}
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') }}
strategy:
matrix:
os: ["ubuntu-22.04"]
cc: ["gcc-11"]
cxx: ["g++-11"]
include:
- os: "ubuntu-22.04"
cc: "clang-14"
cxx: "clang++-14"
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v3
- name: Build
run: bash scripts/build-release.sh
- name: Test
run: ctest --test-dir ./build/ --output-on-failure -T Test
finish:
needs: debug-build-and-test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
parallel-finished: true