-
Notifications
You must be signed in to change notification settings - Fork 16
181 lines (165 loc) · 5.96 KB
/
build.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Build Library and Tests
on:
pull_request:
paths-ignore:
- '.gitignore'
- '**.md'
- 'src/test/test_data/**'
push:
branches:
- master
paths-ignore:
- '.gitignore'
- '**.md'
- 'src/test/test_data/**'
env:
CONFIGURATION: Release
BUILD_BIOMEVAL_TESTS: ON
BUILD_BIOMEVAL_32BIT: OFF
jobs:
build:
name: Build Matrix
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: macOS-13, arch: x64, shared: ON, force-static-deps: OFF }
- { os: macOS-12, arch: x64, shared: ON, force-static-deps: OFF }
- { os: ubuntu-22.04, arch: x64, shared: ON, force-static-deps: OFF }
- { os: ubuntu-22.04, arch: x64, shared: OFF, force-static-deps: OFF }
- { os: ubuntu-20.04, arch: x64, shared: ON, force-static-deps: OFF }
- { os: ubuntu-20.04, arch: x64, shared: OFF, force-static-deps: OFF }
- { os: windows-2022, arch: x64, shared: OFF, force-static-deps: OFF }
- { os: windows-2019, arch: x64, shared: OFF, force-static-deps: OFF }
- { os: windows-2019, arch: x64, shared: ON, force-static-deps: OFF }
- { os: windows-2019, arch: x86, shared: ON, force-static-deps: OFF }
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: false
# The Mono framework on macOS GitHub Runners provides some really old and
# conflicting libraries at high precedence, so remove it.
- name: Remove Mono Framework (macOS)
if: ${{ runner.os == 'macOS' }}
shell: bash
run: sudo rm -rf /Library/Frameworks/Mono.framework
- name: Prepare for Package Cache (Windows)
if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
mkdir -p ${VCPKG_INSTALLATION_ROOT}/bincache
echo "VCPKG_DEFAULT_BINARY_CACHE=${VCPKG_INSTALLATION_ROOT}/bincache" >> ${GITHUB_ENV}
- name: Package Cache (Windows)
if: ${{ runner.os == 'Windows' }}
id: vcpkg-cache
uses: actions/cache@v4
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-SHARED_${{ matrix.config.shared }}-STATIC_${{ matrix.config.force-static-deps }}-vcpkg
restore-keys: |
${{ matrix.config.os }}-${{ matrix.config.arch }}-SHARED_${{ matrix.config.shared }}-STATIC_${{ matrix.config.force-static-deps }}-vcpkg
- name: Install Packages (Linux)
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
sudo apt -y install \
libavcodec-dev \
libavformat-dev \
libdb++-dev \
libhwloc-dev \
libjpeg-dev \
libopenjp2-7-dev \
libopenmpi-dev \
libpcsclite-dev \
libpng-dev \
libsqlite3-dev \
libswscale-dev \
libssl-dev \
libtiff-dev \
zlib1g-dev
- name: Install Packages (macOS)
if: ${{ runner.os == 'macOS' }}
shell: bash
# FIXME: homebrew's open-mpi package doesn't include C++ bindings
# FIXME: we're not compatible with latest ffmpeg
run: |
HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 \
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install \
berkeley-db \
hwloc \
jpeg-turbo \
libpng \
libtiff \
openjpeg \
openssl \
sqlite \
zlib
- name: Install Packages (Windows)
if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
vcpkg install \
--triplet=${{ matrix.config.arch }}-windows-static \
berkeleydb \
hwloc \
libjpeg-turbo \
liblzma \
libpng \
openjpeg \
openssl \
sqlite3 \
tiff \
zlib
vcpkg install --triplet=${{ matrix.config.arch }}-windows \
berkeleydb \
hwloc \
libjpeg-turbo \
liblzma \
libpng \
openjpeg \
openssl \
sqlite3 \
tiff \
zlib
- name: Create Build Directory
run: cmake -E make_directory ${{ github.workspace }}/build
- name: Configure CMake (Single-config Generator)
if: ${{ runner.os != 'Windows' }}
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
cmake \
-DCMAKE_BUILD_TYPE="${CONFIGURATION}" \
-DBUILD_SHARED_LIBS="${{ matrix.config.shared }}" \
-DBUILD_BIOMEVAL_TESTS="${BUILD_BIOMEVAL_TESTS}" \
-DBUILD_BIOMEVAL_32BIT="${BUILD_BIOMEVAL_32BIT}" \
-DFORCE_STATIC_DEPENDENCIES="${{ matrix.config.force-static-deps }}" \
"${GITHUB_WORKSPACE}"
- name: Configure CMake (Multi-config Generator)
if: ${{ runner.os == 'Windows' }}
shell: bash
env:
cmake_arch_flag: ${{ matrix.config.arch == 'x86' && 'Win32' || 'x64' }}
working-directory: ${{ github.workspace }}\build
run: |
cmake \
-A ${cmake_arch_flag} \
-DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" \
-DCMAKE_CONFIGURATION_TYPES="${CONFIGURATION}" \
-DBUILD_SHARED_LIBS="${{ matrix.config.shared }}" \
-DBUILD_BIOMEVAL_TESTS="${BUILD_BIOMEVAL_TESTS}" \
-DBUILD_BIOMEVAL_32BIT="${BUILD_BIOMEVAL_32BIT}" \
-DOPENSSL_ROOT_DIR="${VCPKG_INSTALLATION_ROOT}/packages/openssl_${{ matrix.config.arch }}-windows-static" \
"${GITHUB_WORKSPACE}"
- name: Build (Single-config Generator)
if: ${{ runner.os != 'Windows' }}
shell: bash
working-directory: ${{ github.workspace }}/build
run: cmake --build .
- name: Build (Multi-config Generator)
if: ${{ runner.os == 'Windows' }}
shell: bash
working-directory: ${{ github.workspace }}/build
run: cmake --build . --config "${CONFIGURATION}"