-
Notifications
You must be signed in to change notification settings - Fork 0
179 lines (156 loc) · 6.1 KB
/
Copy pathlinux.yml
File metadata and controls
179 lines (156 loc) · 6.1 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
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
name: Linux
on:
workflow_call:
env:
CI: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
NODE_OPTIONS: "--no-deprecation"
jobs:
build-linux:
name: build (ubuntu-latest, ${{ matrix.build_type }}, ${{ matrix.toolchain.compiler }})
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
toolchain:
- { preset: linux-clang, compiler: clang }
- { preset: linux-gcc, compiler: gcc }
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1
- name: Write submodule SHA manifest
run: git submodule status | tee submodule-shas.txt
- name: Cache submodules
uses: actions/cache@v4
with:
path: |
.git/modules
thirdparty
key: submodules-${{ runner.os }}-${{ hashFiles('submodule-shas.txt') }}
restore-keys: |
submodules-${{ runner.os }}-
- name: Init submodules
run: git submodule update --init --recursive --depth 1
- name: Get CMake and Ninja
uses: lukka/get-cmake@latest
- name: Setup Compiler Cache
uses: hendrikmuhs/ccache-action@v1.2
with:
variant: ccache
key: Linux-${{ matrix.toolchain.preset }}-${{ matrix.build_type }}
max-size: 5G
- name: Setup Mold Linker
uses: rui314/setup-mold@v1
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install jinja2
- name: Install Linux Dependencies
run: |
set -euo pipefail
sudo apt-get update
# xorg-dev is the GLFW-recommended meta-package: it pulls the full set of
# X11 development headers/libs (libx11, xrandr, xinerama, xcursor, xi, xext,
# and the X protocol headers) that find_package(X11) needs. Installing it
# directly (rather than via a cache-apt action) avoids cache-restore gaps
# where a package is "installed" per the manifest but its files are absent.
sudo apt-get install -y --no-install-recommends \
build-essential \
xorg-dev \
libgl1-mesa-dev libglu1-mesa-dev \
libasound2-dev \
pkg-config libgtk-3-dev libdrm-dev libgbm-dev \
xvfb libxkbcommon-x11-0 libgl1-mesa-dri mesa-utils
- name: Setup Linux Compilers
run: |
set -euo pipefail
if [[ "${{ matrix.toolchain.compiler }}" == "clang" ]]; then
sudo apt-get install -y clang-18 clang++-18 libc++-18-dev libc++abi-18-dev lld-18 llvm-18
echo "CC=clang-18" >> $GITHUB_ENV
echo "CXX=clang++-18" >> $GITHUB_ENV
else
sudo apt-get install -y gcc-13 g++-13
echo "CC=gcc-13" >> $GITHUB_ENV
echo "CXX=g++-13" >> $GITHUB_ENV
fi
echo "LDFLAGS=-fuse-ld=mold" >> $GITHUB_ENV
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
10.0.x
- name: Preflight
run: |
set -euo pipefail
cmake --version
dotnet --info
if [[ -n "${CC:-}" ]] && command -v "$CC" >/dev/null 2>&1; then
"$CC" --version | head -n 1
fi
- name: Configure
run: |
set -euo pipefail
SANITIZERS_FLAG="OFF"
if [[ "${{ matrix.build_type }}" == "Debug" ]]; then
SANITIZERS_FLAG="ON"
fi
mkdir -p "build/${{ matrix.toolchain.preset }}"
PYTHON_EXE=$(python3 -c "import sys; print(sys.executable)")
cmake --preset ${{ matrix.toolchain.preset }} \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DPython_EXECUTABLE="${PYTHON_EXE}" \
-DPython3_EXECUTABLE="${PYTHON_EXE}" \
-DCH_CI=ON \
-DENABLE_UNITY_BUILD=OFF \
-DENABLE_SANITIZERS=$SANITIZERS_FLAG \
-DENABLE_LTO=OFF \
-DENABLE_PCH=OFF \
2>&1 | tee "build/${{ matrix.toolchain.preset }}/configure.log"
- name: Build
run: |
set -euo pipefail
cmake --build "build/${{ matrix.toolchain.preset }}" --config ${{ matrix.build_type }} \
2>&1 | tee "build/${{ matrix.toolchain.preset }}/build_${{ matrix.build_type }}.log"
- name: Test
run: |
set -euo pipefail
BUILD_DIR="${{ github.workspace }}/build/${{ matrix.toolchain.preset }}"
export LIBGL_ALWAYS_SOFTWARE=1
export GALLIUM_DRIVER=llvmpipe
export MESA_GL_VERSION_OVERRIDE=4.5
export LSAN_OPTIONS="suppressions=${{ github.workspace }}/.github/lsan.supp"
xvfb-run -a ctest --test-dir "$BUILD_DIR" -C "${{ matrix.build_type }}" --output-on-failure --timeout 300 --output-junit "$BUILD_DIR/junit_${{ matrix.build_type }}.xml" \
2>&1 | tee "$BUILD_DIR/ctest_${{ matrix.build_type }}.log"
- name: Upload Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: Linux-${{ matrix.toolchain.preset }}-${{ matrix.build_type }}-binaries
if-no-files-found: ignore
path: |
build/${{ matrix.toolchain.preset }}/**/*.log
build/${{ matrix.toolchain.preset }}/**/junit_*.xml
retention-days: 7
- name: Upload Release Binaries
if: matrix.build_type == 'Release'
uses: actions/upload-artifact@v4
with:
name: Linux-${{ matrix.toolchain.preset }}-Release-executables
if-no-files-found: ignore
path: |
build/${{ matrix.toolchain.preset }}/bin/Release/ChainedEditor
build/${{ matrix.toolchain.preset }}/bin/Release/ChainedDecos
build/${{ matrix.toolchain.preset }}/bin/Release/*.so
retention-days: 7