-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (101 loc) · 3.42 KB
/
Copy pathci.yml
File metadata and controls
117 lines (101 loc) · 3.42 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
# GitHub Actions CI Workflow for gleditor
# Runs on every push and pull request to ensure builds work
name: CI
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
env:
BUILD_TYPE: Release
jobs:
# ============================================================================
# Linux Build & Test
# ============================================================================
build-linux:
runs-on: ubuntu-22.04
strategy:
matrix:
build-system: [cmake, make]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
pkg-config \
cmake \
libgtk-3-dev \
libgtksourceview-4-dev \
libegl1-mesa-dev \
libgles2-mesa-dev
- name: Build with CMake
if: matrix.build-system == 'cmake'
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ..
cmake --build . --config ${{ env.BUILD_TYPE }} -j$(nproc)
- name: Build with Make
if: matrix.build-system == 'make'
run: |
make -j$(nproc)
- name: Verify binary exists
run: |
if [ "${{ matrix.build-system }}" = "cmake" ]; then
test -f build/gleditor && echo "✓ Binary built successfully"
else
test -f bin/gleditor && echo "✓ Binary built successfully"
fi
# ============================================================================
# macOS Build
# ============================================================================
build-macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install gtk+3 gtksourceview4 pkg-config cmake
- name: Build with CMake
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ..
cmake --build . --config ${{ env.BUILD_TYPE }} -j$(sysctl -n hw.ncpu)
- name: Verify binary exists
run: |
test -f build/gleditor || test -d build/gleditor.app && echo "✓ Binary built successfully"
# ============================================================================
# Windows Build
# ============================================================================
build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
mingw-w64-x86_64-cmake
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-gtk3
mingw-w64-x86_64-gtksourceview4
mingw-w64-x86_64-libepoxy
- name: Build with CMake
run: |
mkdir build && cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ..
cmake --build . --config ${{ env.BUILD_TYPE }} -j$(nproc)
- name: Verify binary exists
run: |
test -f build/gleditor.exe && echo "✓ Binary built successfully"