-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (149 loc) · 4.61 KB
/
build.yml
File metadata and controls
173 lines (149 loc) · 4.61 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
name: Cross-Platform Build
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
jobs:
# ========================================================================
# Linux Build (Wayland)
# ========================================================================
build-linux:
name: Linux (Wayland)
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
libwayland-dev \
wayland-protocols \
libxkbcommon-dev \
libgtk-3-dev \
libgl1-mesa-dev \
pkg-config
- name: Configure CMake
run: |
mkdir -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DGLFW_BUILD_WAYLAND=ON \
-DGLFW_BUILD_X11=OFF
- name: Build
run: |
cd build
make -j$(nproc)
- name: Verify executable
run: |
file build/pcode-editor
ls -lh build/pcode-editor
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: pcode-editor-linux
path: build/pcode-editor
if-no-files-found: error
# ========================================================================
# Windows Build (Win32)
# ========================================================================
build-windows:
name: Windows (Win32)
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. `
-G "Visual Studio 17 2022" `
-A x64 `
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
cd build
cmake --build . --config Release --parallel $env:NUMBER_OF_PROCESSORS
- name: Verify executable
shell: pwsh
run: |
Get-ChildItem build/Release/pcode-editor.exe
(Get-Item build/Release/pcode-editor.exe).Length
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: pcode-editor-windows
path: build/Release/pcode-editor.exe
if-no-files-found: error
# ========================================================================
# FreeBSD Build (X11)
# ========================================================================
build-freebsd:
name: FreeBSD (X11)
runs-on: ubuntu-latest
strategy:
matrix:
freebsd-version: ['14.4']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build on FreeBSD
uses: cross-platform-actions/action@v0.25.0
with:
operating_system: freebsd
version: ${{ matrix.freebsd-version }}
shell: bash
run: |
# Install dependencies
sudo pkg update
sudo pkg install -y \
cmake \
xorg-libX11 \
xorgproto \
gtk3 \
mesa-libs \
pkgconf \
llvm19
# Configure and build
mkdir -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DGLFW_BUILD_WAYLAND=OFF \
-DGLFW_BUILD_X11=ON
make -j$(sysctl -n hw.ncpu)
# Verify
file pcode-editor
ls -lh pcode-editor
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: pcode-editor-freebsd
path: build/pcode-editor
if-no-files-found: error
# ========================================================================
# Summary Job
# ========================================================================
build-summary:
name: Build Summary
needs: [build-linux, build-windows, build-freebsd]
runs-on: ubuntu-latest
if: always()
steps:
- name: Build Status
run: |
echo "## Build Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Platform | Status |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Linux (Wayland) | ${{ needs.build-linux.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Windows (Win32) | ${{ needs.build-windows.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| FreeBSD (X11) | ${{ needs.build-freebsd.result }} |" >> $GITHUB_STEP_SUMMARY