113 lines (102 loc) · 3.73 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
name: Build Mudlet
on:
- pull_request
- push
jobs:
compile-mudlet:
name: ${{matrix.buildname}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
buildname: 'ubuntu'
triplet: x64-linux
compiler: gcc_64
- os: macos-latest
buildname: 'macos / C++ tests'
triplet: x64-osx
compiler: clang_64
- os: windows-latest
buildname: 'windows'
triplet: x64-mingw-dynamic
compiler: win64_mingw73
env:
qt: "5.14.1"
steps:
- name: Restore Qt cache
uses: actions/cache@v1
id: cache-qt
with:
path: ${{runner.workspace}}/Qt/${{env.qt}}
key: ${{runner.os}}-qt-${{env.qt}}
restore-keys: |
${{runner.os}}-qt-
- name: Install Qt
uses: jurplel/install-qt-action@v2
if: steps.cache-qt.outputs.cache-hit != 'true'
with:
version: ${{env.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
- name: "Set location of vcpkg dependencies"
env:
vcpkgResponseFile: ${{github.workspace}}/3rdparty/our-vcpkg-dependencies/vcpkg-${{matrix.triplet}}-dependencies
run: |
echo "::set-env name=vcpkgResponseFile::$vcpkgResponseFile"
shell: bash
- name: (macOS) Install homebrew dependencies
if: runner.os == 'macOS'
run: |
# these aren't available or don't work well in vcpkg
brew install pkg-config libzzip libzip
- name: (Linux) Install apt 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 pkg-config libzip-dev libglu1-mesa-dev libpulse-dev libxkbcommon-x11-0 libqt5x11extras5
- name: (Windows) Install boost dependency
if: runner.os == 'Windows'
run: |
$env:WORKING_BASE_DIR = "${{runner.workspace}}\src"
echo "WORKING_BASE_DIR has been set to $env:WORKING_BASE_DIR"
. ${{github.workspace}}\CI\appveyor.functions.ps1
InstallBoost
shell: powershell
- name: debug stdout/stderr
if: always()
run: |
$env:WORKING_BASE_DIR = "${{runner.workspace}}\src"
echo "stderr"
cat $env:WORKING_BASE_DIR\stderr.log
echo "stdout"
cat $env:WORKING_BASE_DIR\stdout.log
# 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@v4
with:
vcpkgArguments: '@${{env.vcpkgResponseFile}}'
vcpkgDirectory: '${{github.workspace}}/3rdparty/vcpkg'
appendedCacheKey: ${{hashFiles(env.vcpkgResponseFile)}}-newkey
- 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=${{runner.workspace}}/Qt/${{env.qt}}/${{matrix.compiler}}/
- name: Run C++ tests (macOS)
if: runner.os == 'macOS'
working-directory: '${{runner.workspace}}/b/ninja'
run: ctest --output-on-failure