-
Notifications
You must be signed in to change notification settings - Fork 252
140 lines (121 loc) · 4.7 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
name: Descent 3 Build
on:
workflow_dispatch:
push:
branches: [ "main" ]
paths-ignore:
- '**/*.md'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**/README.md'
- '**/LICENSE'
jobs:
build:
name: ${{ matrix.os.name }}, ${{ matrix.build_type }}
strategy:
fail-fast: false
matrix:
os:
- runner: windows-latest
preset: win
cc: cl
cxx: cl
name: Windows-x64
- runner: macos-14 # Apple Silicon, but we cross-compile
preset: mac
cc: cc
cxx: c++
name: macOS-Intel
- runner: macos-14 # Apple Silicon
preset: mac
cc: cc
cxx: c++
name: macOS-ARM
- runner: ubuntu-latest
preset: linux
cc: gcc
cxx: g++
name: Linux-x64
- runner: ubuntu-latest
preset: linux
cc: clang
cxx: clang++
name: Linux-x64-clang
- runner: ubuntu-latest
preset: linux-cross-arm64
name: Linux-cross-arm64
- runner: ubuntu-latest
name: android
build_type:
- Debug
- Release
runs-on: ${{ matrix.os.runner }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install macOS Rosetta 2
if: ${{ matrix.os.name == 'macOS-Intel' }}
run: /usr/sbin/softwareupdate --install-rosetta --agree-to-license
- name: Install Intel version of Brew
if: ${{ matrix.os.name == 'macOS-Intel' }}
shell: arch -x86_64 /bin/bash -e {0}
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/usr/local/bin/brew shellenv)" # makes the Intel version of Brew and its installs are enshrined as the default
echo "PATH=$PATH" >> $GITHUB_ENV # modify $PATH so the above step persists into the future steps
- name: Install macOS dependencies
if: ${{ matrix.os.preset == 'mac' }}
run: brew bundle install
- name: Install Linux dependencies
if: ${{ matrix.os.runner == 'ubuntu-latest' }}
run: |
sudo apt update
sudo apt install -y --no-install-recommends \
ninja-build cmake g++ curl pkg-config autoconf automake libtool libltdl-dev make python3-jinja2 libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libibus-1.0-dev libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev
- name: Install Linux Cross-compilation dependencies
if: ${{ matrix.os.preset == 'linux-cross-arm64' }}
run: |
sudo apt install -y --no-install-recommends \
gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Install Windows dependencies
if: ${{ matrix.os.runner == 'windows-latest' }}
run: choco install ninja
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os.runner == 'windows-latest' }}
with:
arch: win64
- uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: vcpkg.json
- uses: actions/setup-java@v4
if: ${{ matrix.os.name == 'android' }}
with:
java-version: '17'
distribution: 'temurin'
- name: Build APK
if: ${{ matrix.os.name == 'android' }}
run: ./gradlew build
- name: Configure CMake
if: ${{ matrix.os.name != 'android' }}
env:
CC: ${{ matrix.os.cc }}
CXX: ${{ matrix.os.cxx }}
run: cmake --preset ${{ matrix.os.preset }} -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DUSE_EXTERNAL_PLOG=ON -DBUILD_EDITOR=ON -DBUILD_TESTING=ON
- name: Build ${{ matrix.build_type }}
if: ${{ matrix.os.name != 'android' }}
run: cmake --build --preset ${{ matrix.os.preset }} --config ${{ matrix.build_type }} --verbose
- name: Run ${{ matrix.build_type }} Unittests
if: ${{ matrix.os.preset != 'linux-cross-arm64' && matrix.os.name != 'android' }}
run: ctest --preset ${{ matrix.os.preset }} -C ${{ matrix.build_type }}
- name: Local install
if: ${{ matrix.os.name != 'android' }}
# There no cmake install presets so install in traditional way
run: cmake --install builds/${{ matrix.os.preset }}/ --config ${{ matrix.build_type }}
- name: Upload Artifacts
if: ${{ matrix.os.name != 'android' }}
uses: actions/upload-artifact@v4
with:
name: Descent3_${{ matrix.build_type }}_${{ matrix.os.name }}
path: ${{ github.workspace }}/builds/${{ matrix.os.preset }}/installed/