forked from koreader/koreader
-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (155 loc) · 5.36 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
184
185
name: build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [push, pull_request]
permissions:
contents: read
actions: write
jobs:
Tests:
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- name: 'Linux x86_64 (Clang)'
os: ubuntu-latest
target: emulator-linux-x86_64
target_options: |
b_lto = false
strip = false
[binaries]
c = [CCACHE, 'clang', '-g']
c_ld = 'lld'
cpp = [CCACHE, 'clang++', '-g']
cpp_ld = 'lld'
cache_extra_key: tests_clang
extra_packages: >
clang-15 lld-15
extra_setup: |
run sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 60
run sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 60
run sudo update-alternatives --install /usr/bin/lld lld /usr/bin/lld-15 60
run sudo update-alternatives --install /usr/bin/lld-link lld-link /usr/bin/lld-link-15 60
run clang --version
run clang++ --version
- name: 'Linux x86_64 (GCC)'
os: ubuntu-20.04
target: emulator-linux-x86_64
target_options: |
b_lto = false
strip = false
[binaries]
c = [CCACHE, 'gcc', '-ggdb']
cpp = [CCACHE, 'g++', '-ggdb']
[constants]
static_if_amalgam = 'static'
cache_extra_key: tests_gcc
extra_packages: >
gcc-10
g++-10
extra_setup: |
run sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 --slave /usr/bin/g++ g++ /usr/bin/g++-10
run gcc --version
run g++ --version
name: "Test: ${{ matrix.name }}"
runs-on: ${{ matrix.os }}
continue-on-error: ${{ !!matrix.continue-on-error }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
clean: false
fetch-depth: 0
filter: tree:0
show-progress: false
- name: Build & Test
uses: ./.github/actions/build
with:
name: ${{ matrix.name }}
target: ${{ matrix.target }}
target_options: ${{ matrix.target_options }}
cache_extra_key: ${{ matrix.cache_extra_key }}
extra_packages: ${{ matrix.extra_packages }}
extra_setup: ${{ matrix.extra_setup }}
tests: ${{ matrix.tests || 'all' }}
Release:
needs: Tests
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- name: 'Android ARM'
os: ubuntu-latest
target: android-arm
target_options: |
[constants]
static_if_amalgam = 'static'
update_target: android-arm
update_artifacts: 'koreader-*-aligned-debugSigned.apk'
- name: 'Android ARM64'
os: ubuntu-latest
target: android-arm64
target_options: |
[constants]
static_if_amalgam = 'static'
update_target: android-arm64
update_artifacts: 'koreader-*-aligned-debugSigned.apk'
- name: 'Android x86'
os: ubuntu-latest
target: android-x86
target_options: |
[constants]
static_if_amalgam = 'static'
update_target: android-x86
update_artifacts: 'koreader-*-aligned-debugSigned.apk'
- name: 'Kindle Paperwhite 2'
os: ubuntu-latest
target: kindlepw2
target_options: |
buildtype = 'minsize'
debug = false
[constants]
static_if_amalgam = 'static'
update_target: kindlepw2
update_artifacts: '*.targz'
- name: 'Linux x86_64 AppImage'
os: ubuntu-20.04
target: emulator-linux-x86_64
target_options: |
sdl = true
[constants]
static_if_amalgam = 'static'
cache_extra_key: appimage
update_target: appimage
update_artifacts: 'koreader-*.AppImage'
extra_packages: >
gcc-10
g++-10
extra_setup: |
run sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 --slave /usr/bin/g++ g++ /usr/bin/g++-10
run gcc --version
run g++ --version
name: "Release: ${{ matrix.name }}"
runs-on: ${{ matrix.os }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
clean: false
fetch-depth: 0
filter: tree:0
show-progress: false
- name: Build
uses: ./.github/actions/build
with:
name: ${{ matrix.name }}
target: ${{ matrix.target }}
target_options: ${{ matrix.target_options }}
cache_extra_key: ${{ matrix.cache_extra_key }}
update_target: ${{ matrix.update_target }}
update_artifacts: ${{ matrix.update_artifacts }}
extra_packages: ${{ matrix.extra_packages }}
extra_setup: ${{ matrix.extra_setup }}