-
Notifications
You must be signed in to change notification settings - Fork 1
208 lines (169 loc) · 7.29 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: CMake on multiple platforms
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_call:
inputs:
build_type:
description: Type of build (Debug, Release, RelWithDebInfo, MinSizeRel)
type: string
default: Debug
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
qt_host: linux
qt_version: '6.6.0'
qt_modules: 'qt6-multimedia-dev'
runs-on: ${{ matrix.os }}
env:
INSTALL_DIR: "install"
INSTALL_APPIMAGE_DIR: "install-appdir"
BUILD_DIR: "build"
steps:
- uses: actions/checkout@v3
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: 'Install Qt 6.6.0'
if: runner.os == 'Linux'
uses: jurplel/[email protected]
with:
version: 6.6.0
modules: qtmultimedia
- name: 'Checkout wpilib'
uses: actions/checkout@v4
with:
repository: 'wpilibsuite/allwpilib'
# ref: 'v2024.1.1-beta-3' # MAY want 2023
path: 'allwpilib'
- name: 'Prepare ntcore'
run: |
cd allwpilib
git apply ../.github/patches/No-Werror.patch
sed -i 's/protobuf/Protobuf/g' wpiutil/wpiutil-config.cmake.in
cd ..
- name: 'Install Python Dependencies (Linux)'
if: runner.os == 'Linux'
run: |
pip install jinja2
- name: 'Build ntcore (Linux)'
if: runner.os == 'Linux'
run: |
sudo apt-get install libprotobuf-dev libprotobuf17 libstdc++-10-dev gcc-10
cmake -B wpilib_build -S "allwpilib" \
-DCMAKE_INSTALL_PREFIX='/usr' \
-DUSE_SYSTEM_EIGEN=OFF \
-DUSE_SYSTEM_FMTLIB=OFF \
-DWITH_JAVA=OFF \
-DWITH_CSCORE=OFF \
-DWITH_NTCORE=ON \
-DWITH_WPIMATH=OFF \
-DWITH_WPILIB=OFF \
-DWITH_TESTS=OFF \
-DWITH_GUI=OFF \
-DWITH_SIMULATION_MODULES=OFF \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \
-Wno-dev
cmake --build wpilib_build --parallel $(nproc)
sudo cmake --install wpilib_build
- name: Prepare AppImage (Linux)
if: runner.os == 'Linux'
run: |
wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage"
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
- name: Configure CMake (Linux)
if: runner.os == 'Linux'
run: |
cmake -S . -B ${{ env.BUILD_DIR }} \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
-DENABLE_LTO=ON
-G Ninja
- name: Build
run: |
cmake --build ${{ env.BUILD_DIR }} --parallel $(nproc)
# - name: Test
# working-directory: ${{ steps.strings.outputs.build-output-dir }}
# # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest --build-config ${{ matrix.build_type }}
- name: Package (Linux)
if: runner.os == 'Linux'
run: |
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_DIR }}
cd ${{ env.INSTALL_DIR }}
tar --owner root --group root -czf ../QFRCDashboard.tar.gz *
- name: Package AppImage (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_APPIMAGE_DIR }}/usr
export OUTPUT="QFRCDashboard-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage"
chmod +x linuxdeploy-*.AppImage
mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
cp -r /home/runner/work/QFRCDashboard/Qt/${{ matrix.qt_version }}/gcc_64/plugins/iconengines/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 ${{ env.INSTALL_APPIMAGE_DIR }}//usr/lib/
./linuxdeploy-x86_64.AppImage --appdir ${{ env.INSTALL_APPIMAGE_DIR }} --output appimage --plugin qt
build-windows:
name: "Build - Windows"
runs-on: windows-2022
steps:
- uses: ilammy/msvc-dev-cmd@v1
- name: Install CMake
uses: lukka/[email protected]
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install jinja
run: |
python -m ensurepip
python -m pip install jinja2
- uses: actions/checkout@v3
- name: 'Checkout wpilib'
uses: actions/checkout@v4
with:
repository: 'wpilibsuite/allwpilib'
# ref: 'v2024.1.1-beta-3' # MAY want 2023
path: 'allwpilib'
- name: Run vcpkg
uses: lukka/[email protected]
with:
vcpkgDirectory: ${{ runner.workspace }}/allwpilib/vcpkg
vcpkgGitCommitId: 78b61582c9e093fda56a01ebb654be15a0033897 # HEAD on 2023-08-6
- name: 'Prepare ntcore'
run: |
cd allwpilib
git apply ../.github/patches/No-Werror.patch
cd ..
- name: Build ntcore - Windows
run: |
cmake -S allwpilib -B win-nt-build -G "Ninja" -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release -DWITH_JAVA=OFF -DWITH_EXAMPLES=OFF -DUSE_SYSTEM_FMTLIB=ON -DUSE_SYSTEM_LIBUV=ON -DUSE_SYSTEM_EIGEN=ON -DWITH_CSCORE=OFF -DWITH_NTCORE=ON -DWITH_WPIMATH=OFF -DWITH_WPILIB=OFF -DWITH_TESTS=OFF -DWITH_GUI=OFF -DWITH_SIMULATION_MODULES=OFF -DCMAKE_TOOLCHAIN_FILE=${{ runner.workspace }}/allwpilib/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_INSTALL_OPTIONS=--clean-after-build -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_HOST_TRIPLET=x64-windows-release -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DENABLE_LTO=ON
cmake -B win-nt-build --parallel $(nproc)
cmake --install win-nt-build --prefix install --component portable
env:
SCCACHE_GHA_ENABLED: "true"
- name: 'Install Qt (windows)'
uses: jurplel/[email protected]
with:
version: 6.6.0
modules: qtmultimedia
- name: 'Build (Windows)'
working-directory: winbuild
run: cmake --build . --parallel $(nproc)
env:
SCCACHE_GHA_ENABLED: "true"
- name: Package (Windows)
run: |
cmake --install winbuild --prefix install --component portable