-
-
Notifications
You must be signed in to change notification settings - Fork 9
113 lines (93 loc) · 3.51 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
# Copyright 2025 Xenon Emulator Project
name: Build
on: [push, pull_request]
concurrency:
group: ci-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'push' }}
env:
BUILD_TYPE: Release
jobs:
Windows:
runs-on: windows-2025
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- name: Cache CMake Configuration
uses: actions/cache@main
env:
cache-name: ${{ runner.os }}-xenon-cache-config-windows
with:
path: |
${{github.workspace}}/build
key: ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
restore-keys: |
${{ env.cache-name }}-
- name: Cache CMake Build
uses: hendrikmuhs/ccache-action@v1.2.17
env:
cache-name: ${{ runner.os }}-xenon-cache-build-windows
with:
append-timestamp: false
key: ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
- name: Setup VS Environment
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: amd64
- name: Configure CMake
run: cmake --fresh -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $env:NUMBER_OF_PROCESSORS
- name: Upload Windows Artifact
uses: actions/upload-artifact@main
with:
name: Xenon-win64
path: ${{github.workspace}}/build/Xenon.exe
Linux:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y ninja-build clang lld cmake ccache \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev \
libxi-dev libxinerama-dev libwayland-dev libxkbcommon-dev \
wayland-protocols
- name: Cache CMake Configuration
uses: actions/cache@main
env:
cache-name: ${{ runner.os }}-xenon-cache-config-linux
with:
path: |
${{github.workspace}}/build
key: ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
restore-keys: |
${{ env.cache-name }}-
- name: Cache CMake Build
uses: hendrikmuhs/ccache-action@v1.2.17
env:
cache-name: ${{ runner.os }}-xenon-cache-build-linux
with:
append-timestamp: false
key: ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
- name: Configure CMake
run: cmake --fresh -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(nproc)
- name: Upload Linux Artifact
uses: actions/upload-artifact@main
with:
name: Xenon-linux64
path: ${{github.workspace}}/build/Xenon
linux_nix:
name: Linux (nix)
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@main
- uses: cachix/install-nix-action@v27
- name: Build Xenon
run: nix build .#xenon -L