-
-
Notifications
You must be signed in to change notification settings - Fork 132
153 lines (136 loc) · 4.18 KB
/
Copy pathbuild.yml
File metadata and controls
153 lines (136 loc) · 4.18 KB
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
name: Build
on:
push:
branches: [ main ]
<<: &ci_paths
paths-ignore:
- 'deps/**'
paths:
- 'src/**'
- 'include/**'
- '**/*.cmake'
- 'CMakeLists.txt'
- '**/CMakeLists.txt'
- '.gitmodules'
- '.github/workflows/build.yml'
pull_request:
branches: [ main ]
<<: *ci_paths
workflow_dispatch:
jobs:
build-and-test:
strategy:
matrix:
os: [ubuntu-22.04, macos-latest, windows-2022]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache apt packages (Linux)
if: runner.os == 'Linux'
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/build.yml') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
ninja-build \
libasound2-dev \
libjack-jackd2-dev \
ladspa-sdk \
libcurl4-openssl-dev \
libfontconfig1-dev \
libfreetype6-dev \
libx11-dev \
libxcomposite-dev \
libxcursor-dev \
libxext-dev \
libxinerama-dev \
libxrandr-dev \
libxrender-dev \
libglu1-mesa-dev \
mesa-common-dev
- name: Setup Boost (Linux)
if: runner.os == 'Linux'
id: install-boost-linux
uses: MarkusJx/install-boost@v2.4.5
with:
boost_version: 1.83.0
platform_version: 22.04
toolset: gcc
- name: Cache Homebrew (macOS)
if: runner.os == 'macOS'
uses: actions/cache@v4
with:
path: |
~/Library/Caches/Homebrew
/usr/local/Cellar
key: ${{ runner.os }}-brew-${{ hashFiles('.github/workflows/build.yml') }}
restore-keys: |
${{ runner.os }}-brew-
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install cmake ninja
- name: Setup Boost (macOS)
if: runner.os == 'macOS'
id: install-boost-macos
uses: MarkusJx/install-boost@v2.4.5
with:
boost_version: 1.83.0
platform_version: 11
toolset: clang
- name: Install Boost headers (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$boost_ver = "1.83.0"
$boost_dir = "boost_$($boost_ver -replace '\.','_')"
$url = "https://archives.boost.io/release/$boost_ver/source/${boost_dir}.zip"
Invoke-WebRequest -Uri $url -OutFile boost.zip
New-Item -ItemType Directory -Force -Path C:\local
Expand-Archive -Path boost.zip -DestinationPath C:\local
echo "BOOST_ROOT=C:\local\$boost_dir" >> $env:GITHUB_ENV
- name: Setup MSVC environment (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-ccache-${{ github.sha }}
restore-keys: |
${{ matrix.os }}-ccache-
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: |
cmake -B build -G Ninja `
-DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl `
-DCMAKE_BUILD_TYPE=Release `
-DELEMENT_ENABLE_ASIO=ON `
-DELEMENT_ENABLE_UPDATER=ON `
-DELEMENT_BUILD_PLUGINS=ON
- name: Configure CMake (Unix)
if: runner.os != 'Windows'
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DELEMENT_ENABLE_UPDATER=${{ runner.os == 'macOS' && 'ON' || 'OFF' }} \
-DELEMENT_BUILD_PLUGINS=ON
env:
BOOST_ROOT: ${{ steps.install-boost-linux.outputs.BOOST_ROOT || steps.install-boost-macos.outputs.BOOST_ROOT }}
- name: Build
run: cmake --build build --config Release
- name: Run tests
run: ctest --test-dir build --output-on-failure