-
-
Notifications
You must be signed in to change notification settings - Fork 248
193 lines (170 loc) · 6.61 KB
/
build-mudlet.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
182
183
184
185
186
187
188
189
190
191
192
193
name: Build Mudlet
on:
push:
branches: [master, development]
pull_request:
jobs:
compile-mudlet:
name: ${{matrix.buildname}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
buildname: 'ubuntu / gcc'
triplet: x64-linux
compiler: gcc_64
qt: '5.14.1'
- os: ubuntu-latest
buildname: 'ubuntu / clang'
triplet: x64-linux
compiler: clang_64
qt: '5.14.1'
- os: ubuntu-latest
buildname: 'ubuntu / qt 5.11'
triplet: x64-linux
compiler: gcc_64
qt: '5.11.0'
- os: macos-latest
buildname: 'macos / c++ tests'
triplet: x64-osx
compiler: clang_64
qt: '5.14.1'
- os: windows-2019
buildname: 'windows'
triplet: x64-mingw-dynamic
# compiler: flag not used in windows pipeline
qt: '5.14.1'
steps:
- name: Restore Qt cache
uses: actions/cache@v2
# 5.11 cache restoration goes awry
if: matrix.qt != '5.11.0'
id: cache-qt
with:
path: ${{runner.workspace}}/Qt/${{matrix.qt}}
key: ${{matrix.os}}-qt-${{matrix.qt}}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{matrix.qt}}
dir: ${{runner.workspace}}
arch: win64_mingw73 # this key is relevant only for windows
cached: ${{steps.cache-qt.outputs.cache-hit}}
- name: Checkout Mudlet source code
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
# Restore from cache the previously built ports. If "cache miss", then provision vcpkg, install desired ports, finally cache everything for the next run.
- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v5
env:
vcpkgResponseFile: ${{github.workspace}}/3rdparty/our-vcpkg-dependencies/vcpkg-${{matrix.triplet}}-dependencies
with:
vcpkgArguments: '@${{env.vcpkgResponseFile}}'
vcpkgDirectory: '${{github.workspace}}/3rdparty/vcpkg'
appendedCacheKey: ${{hashFiles(env.vcpkgResponseFile)}}-newkey
- name: (macOS) Install non-vcpkg dependencies
if: runner.os == 'macOS'
run: |
# these aren't available or don't work well in vcpkg
brew install pkg-config libzzip libzip ccache
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV
- name: (Linux) Install non-vcpkg dependencies
if: runner.os == 'Linux'
run: |
# Installing packages might fail as the github image becomes outdated
sudo apt update
# These aren't available or don't work well in vcpkg
sudo apt install ccache pkg-config libzip-dev libglu1-mesa-dev libpulse-dev
echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV
- name: (Windows) Install non-vcpkg dependencies
if: runner.os == 'Windows'
shell: powershell
run: |
# Use pre-installed Boost
echo "BOOST_ROOT=$env:BOOST_ROOT_1_72_0" >> $env:GITHUB_ENV
# Install dependencies not available on machine
$env:WORKING_BASE_DIR = "${{runner.workspace}}\src"
$env:MINGW_BASE_DIR = "${{runner.workspace}}\mingw73_64"
echo "MINGW_BASE_DIR=$env:MINGW_BASE_DIR" >> $env:GITHUB_ENV
. ${{github.workspace}}\CI\appveyor.functions.ps1
# Libzip install complains when \bin is missing
New-Item -ItemType Directory -Path "$env:MINGW_BASE_DIR\bin"
SetQtBaseDir "$env:WORKING_BASE_DIR\verbose_output.log"
SetMingwBaseDir "$env:WORKING_BASE_DIR\verbose_output.log"
SetLuarocksPath "$env:WORKING_BASE_DIR\verbose_output.log"
$NoShPath = filterPathForSh
CheckAndInstallZlib
CheckAndInstallLibzip
- name: (Linux Clang) change compiler
if: runner.os == 'Linux' && matrix.compiler == 'clang_64'
run: |
echo "CXX=clang++" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
- name: (Qt 5.11) disable optional components
if: matrix.qt == '5.11.0'
run: |
echo "WITH_UPDATER=no" >> $GITHUB_ENV
echo "WITH_3DMAPPER=no" >> $GITHUB_ENV
echo "WITH_FONTS=no" >> $GITHUB_ENV
- name: (Linux/macOS) restore ccache
uses: actions/cache@v2
with:
path: ${{runner.workspace}}/ccache
key: ccache-${{matrix.os}}-${{matrix.compiler}}-${{matrix.qt}}-${{github.sha}}
restore-keys: ccache-${{matrix.os}}-${{matrix.compiler}}-${{matrix.qt}}-
if: matrix.os != 'windows-latest'
- name: (Windows) Set build info
if: runner.os == 'Windows'
shell: pwsh
run: |
Get-ChildItem env:
${{github.workspace}}\CI\validate_deployment.ps1
${{github.workspace}}\CI\set-build-info.ps1
- name: Build Mudlet
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{github.workspace}}/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: '${{runner.workspace}}/b/ninja'
cmakeAppendedArgs: >-
--target test
-G Ninja
-DCMAKE_PREFIX_PATH=${{env.MINGW_BASE_DIR}}
-DVCPKG_APPLOCAL_DEPS=OFF
- name: (Windows) package Mudlet
if: runner.os == 'Windows'
shell: pwsh
run: '${{github.workspace}}\CI\after_success.ps1'
# cd "$Env:APPVEYOR_BUILD_FOLDER"
# .\CI\after_success.ps1
- name: Run C++ tests (macOS)
if: runner.os == 'macOS'
working-directory: '${{runner.workspace}}/b/ninja'
run: ctest --output-on-failure
- uses: actions/upload-artifact@v2
if: always()
with:
name: ${{runner.os}}-build-directory
path: '${{runner.workspace}}/b/ninja' # or path/to/artifact
- name: (windows) Show relevant logs
if: failure() && runner.os == 'Windows'
run: |
$env:WORKING_BASE_DIR = "${{runner.workspace}}\src"
if (Test-Path -Path "$env:WORKING_BASE_DIR\stderr.log") {
echo "Standard error log from non-vcpkg dependencies: "
cat $env:WORKING_BASE_DIR\stderr.log
}
if (Test-Path -Path "$env:WORKING_BASE_DIR\stdout.log") {
echo "Standard output log from non-vcpkg dependencies: "
cat $env:WORKING_BASE_DIR\stdout.log
}
if (Test-Path -Path "${{runner.workspace}}/b/ninja/CMakeFiles/CMakeOutput.log") {
echo "CMakeOutput.log: "
cat "${{runner.workspace}}/b/ninja/CMakeFiles/CMakeOutput.log"
}