forked from libui-ng/libui-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
183 lines (177 loc) · 5.64 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
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
174
175
176
177
178
179
180
181
182
183
# build libui-ng
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
meson-linux:
strategy:
fail-fast: false
matrix:
# ubuntu-18.04, ubuntu-latest (ubuntu-20.04)
os: [ubuntu-latest]
# x86, x64
arch: [x64]
libtype: [static, shared]
# debug, debugoptimized, release
buildtype: [debug]
runs-on: ${{ matrix.os }}
name: Ubuntu-${{ matrix.arch }}-${{ matrix.libtype }}
steps:
- name: Install Meson and Linux Deps
run: |
python3 -m pip install --upgrade pip setuptools wheel
pip3 install meson ninja
sudo apt-get update -y
sudo apt-get install -y libgtk-3-dev xvfb
- name: Checkout
uses: actions/checkout@v4
- name: Meson Setup Build
run: meson setup builddir --buildtype=${{ matrix.buildtype }} --default-library=${{ matrix.libtype }}
- name: Ninja Build
run: ninja -C builddir --verbose
- name: Run Tests
run: xvfb-run meson test -C builddir --verbose
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Ubuntu-${{ matrix.arch }}-${{ matrix.libtype }}-${{ matrix.buildtype }}
# lib + header + examples + test + build-log
path: |
!builddir/meson-out/*.p/
builddir/meson-out/*
ui_unix.h
ui.h
builddir/meson-logs/*.txt
meson-windows:
strategy:
fail-fast: false
matrix:
# windows-latest, windows-2022
os: [windows-latest]
arch: [x86, x64]
libtype: [static] # FIXME [static, shared]
# debug, debugoptimized, release
buildtype: [debug]
runs-on: ${{ matrix.os }}
name: Win-${{ matrix.arch }}-${{ matrix.libtype }}
steps:
# Setup build env
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Meson+Ninja
run: |
python -m pip install --upgrade pip
pip install meson ninja
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Meson Setup Build
shell: cmd
run: meson setup builddir --buildtype=${{ matrix.buildtype }} --default-library=${{ matrix.libtype }}
- name: Ninja Build
run: ninja -C builddir --verbose
- name: Run Tests
run: meson test -C builddir --verbose
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Win-${{ matrix.arch }}-${{ matrix.libtype }}-${{ matrix.buildtype }}
# lib + header + examples + test + build-log
path: |
!builddir/meson-out/*.p/
builddir/meson-out/libui.*
ui_windows.h
ui.h
builddir/meson-out/*.exe
builddir/meson-out/*.pdb
builddir/meson-logs/*.txt
meson-windows-mingw:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
arch: [x64]
# only support static
libtype: [static]
# debug, debugoptimized, release
buildtype: [release]
runs-on: ${{ matrix.os }}
name: Mingw-${{ matrix.arch }}-${{ matrix.libtype }}
defaults:
run:
shell: msys2 {0}
steps:
# Setup build env
- uses: msys2/setup-msys2@v2
with:
update: true
install: >-
base-devel
git
pacboy: >-
toolchain:x
meson:x
- uses: actions/checkout@v4
- name: Meson Setup Build
run: meson setup builddir --buildtype=${{ matrix.buildtype }} --default-library=static
- name: Ninja Build
run: ninja -C builddir --verbose
- name: Run Tests
run: meson test -C builddir --verbose
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Mingw-${{ matrix.arch }}-static-${{ matrix.buildtype }}
# lib + header + examples + test + build-log
path: |
builddir/meson-out/libui.a
ui_windows.h
ui.h
builddir/meson-out/*.exe
builddir/meson-logs/*.txt
meson-macos:
strategy:
fail-fast: false
matrix:
os: [macos-latest]
libtype: [static, shared]
# debug, debugoptimized, release
buildtype: [debug]
runs-on: ${{ matrix.os }}
name: macOS-x64-${{ matrix.libtype }}
steps:
- name: Unbreak Python in Github Actions
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
- name: Install Meson and macOS Deps
run: |
brew update
brew install meson ninja
- name: Checkout
uses: actions/checkout@v4
- name: Meson Setup Build
run: meson setup builddir --buildtype=${{ matrix.buildtype }} --default-library=${{ matrix.libtype }}
- name: Ninja Build
run: ninja -C builddir --verbose
- name: Run Tests
run: meson test -C builddir --verbose
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macOS-x64-${{ matrix.libtype }}-${{ matrix.buildtype }}
# lib + header + examples + test + build-log
path: |
!builddir/meson-out/*.p/
builddir/meson-out/*
ui_darwin.h
ui.h
builddir/meson-logs/*.txt