-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (110 loc) · 3.36 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Build and Test
on: push
jobs:
build-and-test:
strategy:
matrix:
include:
- os: ubuntu
os_ver: "22.04"
cc: gcc-11
cxx: g++-11
config: Release
static_lib: ON
coverage: OFF
examples: ON
- os: ubuntu
os_ver: "20.04"
cc: gcc-10
cxx: g++-10
config: Release
static_lib: ON
coverage: OFF
examples: ON
- os: windows
os_ver: "2022"
cc: cl
cxx: cl
config: Release
static_lib: ON
coverage: OFF
examples: ON
- os: windows
os_ver: "2022"
cc: cl
cxx: cl
config: Debug
static_lib: ON
coverage: OFF
examples: ON
- os: macos
os_ver: "12"
cc: clang
cxx: clang++
config: Release
static_lib: ON
coverage: OFF
examples: ON
- os: macos
os_ver: "12"
cc: clang
cxx: clang++
config: Debug
static_lib: ON
coverage: OFF
examples: ON
- os: macos
os_ver: "11"
cc: clang
cxx: clang++
config: Release
static_lib: ON
coverage: OFF
examples: ON
- os: ubuntu
os_ver: "20.04"
cc: gcc-10
cxx: g++-10
config: Debug
static_lib: OFF
coverage: ON
examples: OFF
fail-fast: false
defaults:
run:
shell: bash
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
runs-on: ${{ matrix.os }}-${{ matrix.os_ver }}
name: ${{ matrix.os }}-${{ matrix.os_ver }} ${{ matrix.cxx }} ${{ matrix.config }} coverage=${{ matrix.coverage }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Project Name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
- name: Create Build Directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Install Linux Libraries
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get -y install xorg-dev libgl1-mesa-dev
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="${{ matrix.config }}" -D${{ env.REPOSITORY_NAME }}_STATIC_LIB="${{ matrix.static_lib }}" -D${{ env.REPOSITORY_NAME }}_COVERAGE="${{ matrix.coverage }}" -D${{ env.REPOSITORY_NAME }}_BUILD_EXAMPLES="${{ matrix.examples }}"
- name: Build
run: cmake --build build --config ${{ matrix.config }}
- name: Setup Mesa3D
uses: bigladder/github-actions/setup-mesa3d@main
with:
install-directory: build\test\${{ matrix.config }}
- name: Test
uses: coactions/setup-xvfb@v1
with:
run: ctest -C ${{ matrix.config }} --output-on-failure
working-directory: build
- name: Code Coverage Analysis
if: matrix.coverage == 'ON'
run: make gcov
working-directory: build
- name: Upload Code Coverage Report
if: matrix.coverage == 'ON'
uses: codecov/codecov-action@v3