forked from FluidSynth/fluidsynth
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (139 loc) · 4.63 KB
/
linux.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: FluidSynth Linux
on:
pull_request:
push:
paths-ignore:
- '.azure/**'
- '.circleci/**'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
INSTALL_LOCATION: ${{github.workspace}}/fluidsynth_install
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
defaults:
run:
shell: bash
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-20.04
strategy:
matrix:
CC: [""]
CXX: [""]
CMAKE_FLAGS: ["-Denable-profiling=1","-Denable-floats=1 -Denable-profiling=1","-Denable-floats=1","-Denable-trap-on-fpe=1","-Denable-fpe-check=1","-Denable-ipv6=0","-Denable-network=0","-Denable-aufile=0","-DBUILD_SHARED_LIBS=0","-Denable-ubsan=1 -Denable-debug=1", "-Denable-debug=1 -DCMAKE_C_FLAGS_DEBUG=-fuse-ld=gold"]
include:
- CC: "clang-7"
CXX: "clang++-7"
CMAKE_FLAGS: ""
- CC: "clang-8"
CXX: "clang++-8"
CMAKE_FLAGS: ""
- CC: "clang-10"
CXX: "clang++-10"
CMAKE_FLAGS: ""
- CC: "clang-12"
CXX: "clang++-12"
CMAKE_FLAGS: ""
- CC: "clang-10"
CXX: "clang++-10"
CMAKE_FLAGS: "-DBUILD_SHARED_LIBS=0"
# clang9 is covered by openSUSE Leap 15.2
# clang11 is covered by openSUSE Leap 15.3
steps:
- uses: actions/checkout@v3
- name: Add apt-get repositories
run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- name: Update apt
run: sudo apt-get update -y
- name: Install Dependencies
run: |
sudo apt-get -yq --no-install-suggests --no-install-recommends install \
clang-7 \
clang-8 \
clang-10 \
clang-12 \
clang-tidy \
cmake \
cmake-data \
g++-7 \
g++-8 \
ladspa-sdk \
libasound2-dev \
libdbus-1-dev \
libglib2.0-dev \
libinstpatch-dev \
libjack-dev \
libpulse-dev \
libreadline-dev \
libsdl2-dev \
libsndfile-dev \
libsystemd-dev \
ninja-build \
libomp-dev \
portaudio19-dev
- name: Configure CMake
run: |
export CC=${{ matrix.CC }}
export CXX=${{ matrix.CXX }}
cmake -S . \
-B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
-Werror=dev \
-DCMAKE_INSTALL_PREFIX=$INSTALL_LOCATION \
-Denable-portaudio=1 \
-Denable-ladspa=1 \
-DNO_GUI=1 \
${{ matrix.CMAKE_FLAGS }}
- name: Build
run: cmake --build build
- name: Test
run: cmake --build build --target check
- name: Demo
run: cmake --build build --target demo
- name: Install
run: cmake --install build && ls -la $INSTALL_LOCATION
- name: Consume from pkg-config
if: ${{ contains(matrix.CMAKE_FLAGS, 'BUILD_SHARED_LIBS=0') }}
run: |
set -e
cat << EOF > static-link-test.c
#include <fluidsynth.h>
int main() { fluid_synth_process(0,0,0,0,0,0); return 0; }
EOF
export PKG_CONFIG_PATH=$INSTALL_LOCATION/lib/pkgconfig
set -x
gcc -fPIE -o static-link-test static-link-test.c $(pkg-config --cflags --static fluidsynth) $(pkg-config --libs --static fluidsynth)
./static-link-test
echo $?
- name: Consume from build
run: |
set -e
export CC=${{ matrix.CC }}
export CXX=${{ matrix.CXX }}
cmake -S test/cmake \
-B consume-build \
-G Ninja \
-DFluidSynth_DIR="${{github.workspace}}/build" \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
cmake --build consume-build
- name: Consume from install
run: |
set -e
export CC=${{ matrix.CC }}
export CXX=${{ matrix.CXX }}
cmake -S test/cmake -B consume-install \
-G Ninja \
-DFluidSynth_DIR="$INSTALL_LOCATION/lib/cmake/fluidsynth" \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
cmake --build consume-install