-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.83 KB
/
build-linux.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
name: Build (Linux)
on:
push:
paths:
- .github/workflows/build-linux.yml
- src/**
- xmake.lua
workflow_dispatch:
jobs:
build:
strategy:
matrix:
mode: [debug, release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Prepare works
# run: |
# mkdir ./.xmake-dest
- name: Restore build cache
uses: actions/cache@v4
with:
path: |
~/.xmake
./.xmake-dest
key: xmake-linux-${{ hashFiles('xmake.lua') }}
restore-keys: |
xmake-linux-
- name: Setup XMake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: '2.9.8'
actions-cache-folder: './.xmake-dest'
- name: Install build dependencies
run: |
sudo apt install -y build-essential llvm-19-dev libclang-19-dev
# workaround to switch llvm version.
sudo mv /usr/include/clang /usr/include/clang-compiler
sudo ln -s /usr/lib/llvm-19/bin/llvm-config /usr/bin/llvm-config
sudo ln -s /usr/include/llvm-19/llvm /usr/include/llvm
sudo ln -s /usr/include/llvm-c-19/llvm-c /usr/include/llvm-c
sudo ln -s /usr/lib/llvm-19/include/clang /usr/include/clang
sudo ln -s /usr/lib/llvm-19/include/clang-c /usr/include/clang-c
- name: Configure
run: |
# c++23 <print> requires gcc 14.
xmake f -a x64 -m ${{ matrix.mode }} -p linux --toolchain=gcc-14 -v -y
- name: Build
run: |
xmake -v -y
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: debuginfo-${{ matrix.mode }}-linux-x64-${{ github.sha }}
path: |
build/linux/x64/${{ matrix.mode }}