-
Notifications
You must be signed in to change notification settings - Fork 3
128 lines (107 loc) · 3.6 KB
/
ci.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: ni-midi2 CI
on:
push:
branches:
- main
- 'bugfix/**'
- 'feature/**'
- 'release/**'
pull_request:
branches: [ main ]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "Windows 2022"
os: windows-2022
build_type: Release
- name: "MacOS 12 (xc13)"
os: macos-12
build_type: Release
set_xcode_version_cmd: xcversion select 13.4.1
- name: "Ubuntu 22.04 (GCC-11)"
os: ubuntu-22.04
build_type: Release
cc: "gcc-11"
cxx: "g++-11"
- name: "Ubuntu 22.04 (GCC-10)"
os: ubuntu-22.04
build_type: Release
cc: "gcc-10"
cxx: "g++-10"
- name: "Ubuntu 22.04 (GCC-9)"
os: ubuntu-22.04
build_type: Release
cc: "gcc-9"
cxx: "g++-9"
- name: "sysex pmr (Ubuntu 22.04, GCC-11)"
os: ubuntu-22.04
cmake_options: "-DNIMIDI2_PMR_SYSEX_DATA=ON"
build_type: Release
cc: "gcc-11"
cxx: "g++-11"
- name: "non-unity builds (Ubuntu 22.04, GCC-11)"
os: ubuntu-22.04
cmake_options: "-DNIMIDI2_UNITY_BUILDS=OFF"
build_type: Release
cc: "gcc-11"
cxx: "g++-11"
- name: "Code-Coverage (Ubuntu 22.04, GCC-10)"
os: ubuntu-22.04
build_type: Coverage
code_coverage: true
cc: "gcc-10"
cxx: "g++-10"
gcov: "gcov-10"
steps:
- name: Set xcode version
if: matrix.config.set_xcode_version_cmd != null
run: |
${{ matrix.config.set_xcode_version_cmd }}
- name: Set compiler version
if: matrix.config.cc != null && matrix.config.cxx != null
run: |
sudo apt install ${{ matrix.config.cc }} ${{ matrix.config.cxx }}
echo "CC=${{ matrix.config.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.config.cxx }}" >> $GITHUB_ENV
- name: Set GCOV version
if: matrix.config.gcov != null
run: |
echo "GCOV=${{ matrix.config.gcov }}" >> $GITHUB_ENV
- name: Checkout source
uses: actions/checkout@v3
- name: Install vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
- name: Configure CMake + Install Dependencies
run: |
cmake -B ${{ github.workspace }}/build . -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} ${{ matrix.config.cmake_options }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: |
cmake --build ${{ github.workspace }}/build --config ${{ matrix.config.build_type }}
- name: Test
working-directory: ${{ github.workspace }}/build
run: |
ctest --verbose -C ${{ matrix.config.build_type }} --timeout 900
- name: Generate Code-Coverage results
if: matrix.config.code_coverage == true
working-directory: ${{ github.workspace }}/build
run: |
sudo apt-get update
sudo apt-get install -y lcov
lcov --version
echo $(which ${GCOV})
lcov --gcov-tool $(which ${GCOV}) -d . -c -o coverage.info
- name: Upload code coverage results
if: matrix.config.code_coverage == true
uses: codecov/[email protected]
with:
files: ${{ github.workspace }}/build/coverage.info
verbose: true
gcov: true
gcov_ignore: tests