-
Notifications
You must be signed in to change notification settings - Fork 4
311 lines (267 loc) · 9.23 KB
/
ci.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
name: CI
on:
push:
branches: [ main ]
tags: [ v* ]
workflow_dispatch:
jobs:
build-ubuntu:
name: Build & Package Ubuntu
runs-on: ubuntu-latest
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
env:
BUILD_WRAPPER_OUT_DIR: sonar_output
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set environment variables
run: |
echo SONAR_CACHE_PATH=$HOME/$BUILD_WRAPPER_OUT_DIR >> $GITHUB_ENV
echo REFLEX_VERSION=`cat .reflex-version` >> $GITHUB_ENV
echo FORCE_CACHE_UPDATE=${RANDOM}${RANDOM} >> $GITHUB_ENV
- name: Sonar data cache
uses: actions/cache@v3
with:
path: ${{ env.SONAR_CACHE_PATH }}
key: ${{ runner.os }}-sonar-cache-${{ env.FORCE_CACHE_UPDATE }}
restore-keys: |
${{ runner.os }}-sonar-cache-
- name: RE/flex cache
uses: actions/cache@v3
with:
path: misc/reflex
key: ${{ runner.os }}-reflex-${{ env.REFLEX_VERSION }}
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v1
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
- name: Configure
run: ./configure release
- name: Build
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v2
- name: Build & save CI packages
run: |
make JX_VERSION=1ci REFLEX_VERSION=1ci release
echo "${{ secrets.SOURCEFORGE_KEY }}" >> sourceforge_key
chmod 0600 sourceforge_key
scp -o StrictHostKeyChecking=no -i sourceforge_key ../jx-application-framework_1ci_*.deb jafl,[email protected]:htdocs/ci/jx-application-framework.deb
scp -o StrictHostKeyChecking=no -i sourceforge_key ../re-flex_1ci_*.deb jafl,[email protected]:htdocs/ci/re-flex.deb
rm -f ../jx-application-framework_1ci_* ../re-flex_1ci_*
build-ubuntu-release:
name: Build & Package Ubuntu Release
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set environment variables
run: |
echo REFLEX_VERSION=`cat .reflex-version` >> $GITHUB_ENV
- name: RE/flex cache
uses: actions/cache@v3
with:
path: misc/reflex
key: ${{ runner.os }}-reflex-${{ env.REFLEX_VERSION }}
- name: Configure
run: ./configure release
- name: Build
run: make
- name: Build release packages
run: |
make release
mv ../jx-application-framework_* .
- name: Save release packages
uses: actions/upload-artifact@v3
with:
name: release
path: jx-application-framework_*
build-fedora:
name: Build & Package Fedora
runs-on: ubuntu-latest
container: fedora:latest
steps:
- name: Install git, zstd for actions/cache, glibc-langpack-en for LC_ALL
run: dnf install -y git zstd glibc-langpack-en
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set environment variables - after glibc-langpack-en is installed
run: |
echo LC_ALL=en_US.utf8 >> $GITHUB_ENV
echo LANG=en_US.utf8 >> $GITHUB_ENV
echo ACE_VERSION=`cat .ace-version` >> $GITHUB_ENV
echo REFLEX_VERSION=`cat .reflex-version` >> $GITHUB_ENV
- name: RE/flex cache
uses: actions/cache@v3
with:
path: misc/reflex
key: fedora-reflex-${{ env.REFLEX_VERSION }}
- name: ACE cache
uses: actions/cache@v3
with:
path: ACE/ACE_wrappers
key: fedora-ace-${{ env.ACE_VERSION }}
- name: Configure
run: ./configure release
- name: Build
run: make
- name: Build & save CI packages
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
run: |
make JX_VERSION=1ci ACE_VERSION=1ci REFLEX_VERSION=1ci release
echo "${{ secrets.SOURCEFORGE_KEY }}" >> sourceforge_key
chmod 0600 sourceforge_key
scp -o StrictHostKeyChecking=no -i sourceforge_key ../jx-application-framework-1ci.*.rpm jafl,[email protected]:htdocs/ci/jx-application-framework-fedora.rpm
scp -o StrictHostKeyChecking=no -i sourceforge_key ../ace-1ci.*.rpm jafl,[email protected]:htdocs/ci/ace-fedora.rpm
scp -o StrictHostKeyChecking=no -i sourceforge_key ../re-flex-1ci.*.rpm jafl,[email protected]:htdocs/ci/re-flex-fedora.rpm
rm -f ../jx-application-framework-1ci.* ../ace-1ci.* ../re-flex-1ci.*
- name: Build release packages
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
make release
mv ../jx-application-framework_* ../jx-application-framework-* .
ls -l
- name: Save release packages
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v3
with:
name: release
path: |
jx-application-framework_*
jx-application-framework-*
build-macos:
name: Build & Package MacOS
runs-on: macos-13
env:
PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure
run: |
./configure release
brew install cask
brew install --cask xquartz
- name: Build
run: make
- name: Build & save CI packages
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
run: |
make JX_VERSION=1ci release
echo "${{ secrets.SOURCEFORGE_KEY }}" >> sourceforge_key
chmod 0600 sourceforge_key
scp -o StrictHostKeyChecking=no -i sourceforge_key ../jx-application-framework_1ci_*.tar.gz jafl,[email protected]:htdocs/ci/jx-application-framework_darwin.tgz
rm -f ../jx-application-framework_1ci_*
- name: Build release packages
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
make release
mv ../jx-application-framework_* .
- name: Save release packages
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v3
with:
name: release
path: jx-application-framework_*
release:
name: Upload releases
runs-on: ubuntu-latest
needs: [ build-ubuntu-release, build-fedora, build-macos ]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/download-artifact@v3
with:
name: release
- name: Save release packages
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: jx-application-framework*
tag: ${{ github.ref }}
file_glob: true
update-homebrew:
name: Update Homebrew Formulas
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.TRIGGER_BUILDS }}
repository: jafl/homebrew-jx
event-type: new-release
coverage:
name: Coverage
runs-on: ubuntu-latest
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set environment variables
run: |
echo REFLEX_VERSION=`cat .reflex-version` >> $GITHUB_ENV
- name: RE/flex cache
uses: actions/cache@v3
with:
path: misc/reflex
key: ${{ runner.os }}-reflex-${{ env.REFLEX_VERSION }}
- name: Configure
run: |
./configure release
- name: Build with code coverage
run: |
make coverage
- uses: codecov/codecov-action@v3
with:
flags: unittests
fail_ci_if_error: true
verbose: true
build-apps:
name: Build apps
runs-on: ubuntu-latest
needs: [ build-ubuntu, build-fedora, build-macos ]
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
strategy:
matrix:
repo:
- drakon
- glove
- jx-ide
- leibnitz
- ssh-askpass
- subversion_client
- system-g
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.TRIGGER_BUILDS }}
repository: jafl/${{ matrix.repo }}
event-type: new-jx