-
-
Notifications
You must be signed in to change notification settings - Fork 56
156 lines (140 loc) · 4.5 KB
/
build_cmake.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
boost: [0, 1]
header_only: [0, 1]
config:
- {
name: "Windows (MSVC)",
os: windows-latest,
cmakeflags: "-DLIBREMIDI_NO_WINUWP=0 -DBOOST_ROOT=$PWD/boost_1_82_0",
test_target: "RUN_TESTS"
}
- {
name: "Ubuntu (gcc)",
os: ubuntu-latest,
cmakeflags: "-DCMAKE_CXX_FLAGS='-Werror=return-type -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1 -D_GLIBCXX_ASSERTIONS=1 -D_GLIBCXX_SANITIZE_VECTOR=1'",
test_target: "test"
}
- {
name: "Ubuntu (clang-17, libstdc++)",
os: ubuntu-latest,
cmakeflags: "-DCMAKE_CXX_COMPILER=clang++-17 -DCMAKE_CXX_FLAGS='-Werror=return-type -fsanitize=address -fsanitize=undefined'",
test_target: "test"
}
- {
name: "Ubuntu (clang, libc++)",
os: ubuntu-latest,
cmakeflags: "-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-stdlib=libc++ -Werror=return-type'",
test_target: "test"
}
- {
name: 'Tarball',
os: ubuntu-latest,
cmakeflags: "",
test_target: "test"
}
- {
name: "macOS",
os: macos-13,
cmakeflags: "-DCMAKE_CXX_FLAGS=-Werror=return-type",
test_target: "test"
}
steps:
- uses: actions/checkout@v3
- name: Get latest release version number
id: get_version
uses: battila7/get-version-action@v2
- uses: maxim-lobanov/setup-xcode@v1
if: runner.os == 'macOS'
with:
xcode-version: latest-stable
- name: Install dependencies
if: matrix.config.name != 'Tarball'
run: |
git submodule update --init --recursive
if [ "$RUNNER_OS" == "Linux" ]; then
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
sudo apt update
sudo apt install cmake libboost-dev libasound-dev libjack-jackd2-dev clang libc++-dev
elif [ "$RUNNER_OS" == "Windows" ]; then
curl -L https://github.com/ossia/sdk/releases/download/sdk28/boost_1_82_0.tar.gz > boost.tar.gz
tar -xzf boost.tar.gz
rm boost.tar.gz
else
brew install boost
fi
shell: bash
- name: Configure
if: matrix.config.name != 'Tarball'
shell: bash
run: |
cmake -S . -B build \
${{ matrix.config.cmakeflags }} \
-DLIBREMIDI_FIND_BOOST=${{ matrix.boost }} \
-DLIBREMIDI_HEADER_ONLY=${{ matrix.header_only }} \
-DLIBREMIDI_EXAMPLES=1 \
-DLIBREMIDI_TESTS=1 \
-DLIBREMIDI_CI=1 \
-DCMAKE_CTEST_ARGUMENTS="--rerun-failed;--output-on-failure" \
-DCMAKE_INSTALL_PREFIX=install
- name: Build
if: matrix.config.name != 'Tarball'
run: |
cmake --build build --config Debug
cmake --build build --config Debug --target install
- name: Test
if: matrix.config.name != 'Tarball'
run: |
# Not available on GH actions...
# if [ "$RUNNER_OS" == "Linux" ]; then
# sudo modprobe snd-virmidi midi_devs=1
# fi
cmake --build build --config Debug --target ${{ matrix.config.test_target }}
shell: bash
build_bsd:
name: FreeBSD
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
boost: [0, 1]
header_only: [0, 1]
steps:
- uses: actions/checkout@v3
- uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg install -y jackit boost-libs cmake git
run: |
pwd
ls -lah
whoami
env
freebsd-version
cmake -S . -B build \
-DLIBREMIDI_FIND_BOOST=${{ matrix.boost }} \
-DLIBREMIDI_HEADER_ONLY=${{ matrix.header_only }} \
-DLIBREMIDI_EXAMPLES=1 \
-DLIBREMIDI_TESTS=1 \
-DLIBREMIDI_CI=1 \
-DCMAKE_CTEST_ARGUMENTS="--rerun-failed;--output-on-failure" \
-DCMAKE_INSTALL_PREFIX=install
cmake --build build
cmake --build build --target install
cmake --build build --target test