-
Notifications
You must be signed in to change notification settings - Fork 4
701 lines (700 loc) · 29.4 KB
/
ci.yml
File metadata and controls
701 lines (700 loc) · 29.4 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
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
name: ci
on:
push: {branches-ignore: [latest], tags: ['*']}
pull_request:
env:
PACKAGE_NAME: ${{ github.event.repository.name }}
PACKAGE_VERSION: ${{ github.sha }}
MYCI_NEXUS_USERNAME: cppfw
MYCI_NEXUS_PASSWORD: ${{ secrets.MYCI_NEXUS_PASSWORD }}
MYCI_GIT_USERNAME: igagis
MYCI_GIT_PASSWORD: ${{ secrets.MYCI_GIT_ACCESS_TOKEN }}
MYCI_CONAN_REMOTE: https://gagis.hopto.org/conan
MYCI_CONAN_USER: cppfw
MYCI_CONAN_PASSWORD: ${{ secrets.MYCI_CONAN_PASSWORD }}
jobs:
##### coverage #####
coverage:
runs-on: ubuntu-latest
container: debian:trixie
name: coverage - measure
env:
linux_distro: debian
linux_release: trixie
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@main
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ env.linux_distro }} ${{ env.linux_release }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci locales git pipx
# - name: add llvm repo (for clang-format)
# uses: myci-actions/add-deb-repo@main
# with:
# repo: deb http://apt.llvm.org/${{ env.linux_release }} llvm-toolchain-${{ env.linux_release }} main
# repo-name: llvm
# keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: git clone
uses: myci-actions/checkout@main
- name: prepare debian package
run: myci-deb-prepare.sh
- name: install deps
run: myci-deb-install-build-deps.sh
- name: add DE locale
# needed for testing that locale with "," as decimal delimiter does not break the parsing with string_parser
run: |
echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
- name: build
run: make config=gcov
- name: test
run: make config=gcov test
- name: generate coverage report
# due to some bug in gcov, we need to use --gcov-ignore-parse-errors=negative_hits.warn
run: pipx run gcovr --gcov-ignore-parse-errors=negative_hits.warn --exclude-throw-branches --filter src/ --cobertura > cobertura.xml
- name: upload coverage report to artifacts
uses: actions/upload-artifact@v4
with:
name: cobertura.xml
path: cobertura.xml
- name: upload coverage data to codecov.io
uses: codecov/codecov-action@v5
if: always() # even if previous steps fail, this one needs to be run
with:
token: ${{ secrets.CODECOV_TOKEN }}
# do not search for coverage files automatically, upload only specified files
disable_search: true
files: cobertura.xml
# flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- name: upload test report to codecov.io
if: always() # even if previous steps fail, this one needs to be run
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
# do not search for coverage files automatically, upload only specified files
disable_search: true
files: tests/unit/out/gcov/junit.xml
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
##### sanitizer #####
sanitizer:
strategy:
fail-fast: false
matrix:
include:
- {os: debian, codename: trixie, image_owner: }
- {os: debian, codename: trixie, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]}
- {os: debian, codename: trixie, image_owner: arm64v8/, labels: [ubuntu-24.04-arm]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: sanitizer - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
env:
CXX: clang++
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@main
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci git clang
# - name: add llvm repo (for clang-format)
# uses: myci-actions/add-deb-repo@main
# with:
# repo: deb http://apt.llvm.org/${{ matrix.codename }} llvm-toolchain-${{ matrix.codename }} main
# repo-name: llvm
# keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: install ci tools
run: |
apt install --assume-yes devscripts equivs
- name: git clone
uses: myci-actions/checkout@main
- name: prepare debian package
run: myci-deb-prepare.sh
- name: install deps
run: myci-deb-install-build-deps.sh
- name: build
run: make config=asan
- name: test
run: make config=asan test
##### lint #####
lint:
runs-on: ubuntu-latest
container: debian:trixie
name: lint
env:
linux_distro: debian
linux_release: trixie
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@main
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ env.linux_distro }} ${{ env.linux_release }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci locales git devscripts equivs
- name: git clone
uses: myci-actions/checkout@main
- name: prepare debian package
run: myci-deb-prepare.sh
- name: install deps
run: myci-deb-install-build-deps.sh
- name: build
run: make config=lint
- name: test
run: make config=lint test
##### deb linux #####
deb:
strategy:
fail-fast: false
matrix:
include:
# - {os: debian, codename: buster, image_owner: }
# - {os: debian, codename: buster, image_owner: i386/, labels: [i386,docker]}
# - {os: debian, codename: buster, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]}
# - {os: debian, codename: bullseye, image_owner: }
# - {os: debian, codename: bullseye, image_owner: i386/, labels: [i386,docker]}
# - {os: debian, codename: bullseye, image_owner: , labels: [ubuntu-24.04-arm]}
# - {os: debian, codename: bullseye, image_owner: , labels: [ubuntu-24.04-arm]}
- {os: debian, codename: bookworm, image_owner: }
# - {os: debian, codename: bookworm, image_owner: i386/, labels: [i386,docker]}
- {os: debian, codename: bookworm, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]}
- {os: debian, codename: bookworm, image_owner: arm64v8/, labels: [ubuntu-24.04-arm]}
- {os: debian, codename: trixie, image_owner: }
# - {os: debian, codename: trixie, image_owner: i386/, labels: [i386,docker]}
- {os: debian, codename: trixie, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]}
- {os: debian, codename: trixie, image_owner: arm64v8/, labels: [ubuntu-24.04-arm]}
# - {os: ubuntu, codename: focal, image_owner: }
# - {os: ubuntu, codename: jammy, image_owner: }
- {os: ubuntu, codename: noble, image_owner: }
# - {os: raspbian, codename: buster, image_owner: igagis/, labels: [ubuntu-24.04-arm]}
# - {os: raspbian, codename: bullseye, image_owner: igagis/, labels: [ubuntu-24.04-arm]}
# - {os: raspbian, codename: bookworm, image_owner: igagis/, labels: [ubuntu-24.04-arm]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: linux - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
steps:
- name: set TZ for ubuntu:focal
run: |
# configure timezone to avoid 'tzdata' package to require user interaction during installation (needed for ubuntu:focal)
TZ=Europe/Helsinki ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@main
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci git python3-pip devscripts equivs
# - name: add llvm repo (for clang-format)
# uses: myci-actions/add-deb-repo@main
# with:
# repo: deb http://apt.llvm.org/${{ matrix.codename }} llvm-toolchain-${{ matrix.codename }} main
# repo-name: llvm
# keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: git clone
uses: myci-actions/checkout@main
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@main
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh)}
- name: prepare debian package
run: myci-deb-prepare.sh
- name: install deps
run: myci-deb-install-build-deps.sh
- name: build
run: |
cd build
dpkg-buildpackage --unsigned-source --unsigned-changes
# - name: publish test report
# uses: EnricoMi/publish-unit-test-result-action/composite@v1.19
# if: always()
# with:
# files: tests/**/junit*.xml
# check_name: "test report: ${{ github.job }} - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}"
- name: deploy deb packages
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
myci-deploy-apt-ssh.sh --key repo_key_rsa --server gagis.hopto.org --repo cppfw/${{ matrix.os }} --distro ${{ matrix.codename }} --component main lib${PACKAGE_NAME}*_${PACKAGE_VERSION}_*.*deb
if: startsWith(github.ref, 'refs/tags/')
##### archlinux #####
# archlinux:
# strategy:
# fail-fast: false
# matrix:
# include:
# - {image: "archlinux:latest", arch: amd64}
# # - {image: "lopsided/archlinux-arm32v7:latest", arch: arm32, labels: [ubuntu-24.04-arm]}
# - {image: "lopsided/archlinux-arm64v8:latest", arch: arm64, labels: [ubuntu-24.04-arm]}
# runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
# container: ${{ matrix.image }}
# name: linux - archlinux - ${{ matrix.arch }}
# steps:
# - name: install ci tools
# run: |
# pacman --sync --refresh --sysupgrade --noconfirm --noprogressbar base-devel git
# - name: add cppfw pacman repo
# uses: myci-actions/add-pacman-repo@main
# with:
# name: cppfw
# url: https://gagis.hopto.org/repo/cppfw/archlinux/${{ matrix.arch }}
# key-server: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
# install: >-
# myci
# - name: git clone
# uses: myci-actions/checkout@main
# - name: set PACKAGE_VERSION
# uses: myci-actions/export-env-var@main
# with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh)}
# # makepkg needs to install dependency packages, so nobody user needs sudo rights
# - name: add nobody to sudoers
# run: |
# echo "nobody ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# - name: build
# run: |
# # provide write access to user nobody
# chmod --recursive 777 .
# cd build/archlinux
# sudo --user=nobody --preserve-env=PACKAGE_VERSION makepkg --syncdeps --noconfirm --skipinteg --noprogressbar
# - name: deploy
# run: |
# echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
# myci-deploy-pacman-ssh.sh --server gagis.hopto.org --key repo_key_rsa --repo cppfw/archlinux/${{ matrix.arch }} --database cppfw build/archlinux/$PACKAGE_NAME-*.pkg.*
# if: startsWith(github.ref, 'refs/tags/')
##### macosx #####
macosx:
runs-on: macos-latest
steps:
- name: workaround python2 and python3 issue when upgrading python
run : |
rm -rf /usr/local/bin/2to3*
rm -rf /usr/local/bin/idle3*
rm -rf /usr/local/bin/pydoc3*
rm -rf /usr/local/bin/python3
rm -rf /usr/local/bin/python3-config
rm -rf /usr/local/bin/python3*
rm -rf /usr/local/bin/python3*-config
- name: git clone
uses: myci-actions/checkout@main
- name: install clang-tidy and clang-format
run: |
brew install llvm
ln -s "$(brew --prefix llvm)/bin/clang-format" "/usr/local/bin/clang-format"
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"
ln -s "$(brew --prefix llvm)/bin/clang-apply-replacements" "/usr/local/bin/clang-apply-replacements"
- name: add cppfw tap
run: |
brew tap cppfw/tap
brew update
- name: install ci tools
run: brew install myci make
- name: set PATH to use latest make
uses: myci-actions/export-env-var@main
with: {name: PATH, value: "$HOMEBREW_PREFIX/opt/make/libexec/gnubin:$PATH"}
- name: set CFLAGS
uses: myci-actions/export-env-var@main
with: {name: CFLAGS, value: "-I $HOMEBREW_PREFIX/include $CFLAGS"}
- name: set CXXFLAGS
uses: myci-actions/export-env-var@main
with: {name: CXXFLAGS, value: "-I $HOMEBREW_PREFIX/include $CXXFLAGS"}
- name: set LDFLAGS
uses: myci-actions/export-env-var@main
with: {name: LDFLAGS, value: "-L $HOMEBREW_PREFIX/lib $LDFLAGS"}
- name: install deps
run: myci-brew-install.sh `myci-list-deps-homebrew.sh`
- name: build
run: make --include-dir=$(brew --prefix)/include
- name: test
run: make --include-dir=$(brew --prefix)/include test
- name: deploy
run: myci-deploy-homebrew.sh --tap cppfw/tap
if: startsWith(github.ref, 'refs/tags/')
##### android #####
android:
runs-on: ubuntu-latest
container: mingc/android-build-box:latest
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@main
with:
repo: deb https://gagis.hopto.org/repo/cppfw/$(lsb_release --id --short | tr '[:upper:]' '[:lower:]') $(lsb_release --codename --short) main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci git ninja-build
- name: git clone
uses: myci-actions/checkout@main
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@main
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh)}
- name: build
run: |
cd build/android
./gradlew copy_aar --warning-mode all
myci-apply-version.sh --version $PACKAGE_VERSION *.pom.in
myci-apply-version.sh --version $PACKAGE_VERSION *.aar.in --filename-only
- name: deploy
run: myci-deploy-maven-nexus.sh --base-url https://gagis.hopto.org/nexus --repo android build/android/$PACKAGE_NAME-$PACKAGE_VERSION.aar
if: startsWith(github.ref, 'refs/tags/')
##### msys2 #####
msys2:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
strategy:
fail-fast: false
matrix:
include:
- {arch: i686, repo: mingw32}
- {arch: x86_64, repo: mingw64}
name: msys2 - ${{ matrix.repo }}
steps:
- name: make msys2 to provide the default shell
uses: msys2/setup-msys2@v2
with:
update: true
msystem: MSYS
install: >-
msys2-devel
mingw-w64-${{ matrix.arch }}-toolchain
- name: add cppfw pacman msys repo
uses: myci-actions/add-pacman-repo@main
with:
name: cppfw_msys
url: https://gagis.hopto.org/repo/cppfw/msys2/msys
shell: 'msys2 {0}'
key-server: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci
- name: add cppfw pacman msys/mingw repo
uses: myci-actions/add-pacman-repo@main
with:
name: cppfw_${{ matrix.repo }}
url: https://gagis.hopto.org/repo/cppfw/msys2/${{ matrix.repo }}
shell: 'msys2 {0}'
key-server: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
- name: git clone
uses: myci-actions/checkout@main
- name: prepare pacman package
run: myci-apply-version.sh build/msys2/PKGBUILD.in
- name: build
# to make makepkg-mingw build only one architecture we need to set the MINGW_ARCH
env: {MINGW_ARCH: '${{ matrix.repo }}'}
run: |
cd build/msys2
PKGEXT='.pkg.tar.xz' makepkg-mingw --syncdeps --noconfirm --skipinteg
- name: deploy
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
for f in $(find build/msys2 -name "mingw-w64-${{ matrix.arch }}-$PACKAGE_NAME-*-any.pkg.*"); do
myci-deploy-pacman-ssh.sh --server gagis.hopto.org --key repo_key_rsa --repo cppfw/msys2/${{ matrix.repo }} --database cppfw_${{ matrix.repo }} $f
done
if: startsWith(github.ref, 'refs/tags/')
##### vcpkg-linux #####
vcpkg-linux:
strategy:
fail-fast: false
matrix:
include:
- {os: debian, codename: bookworm, image_owner: }
# - {os: debian, codename: bookworm, image_owner: i386/, labels: [i386,docker]}
# - {os: debian, codename: bookworm, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]}
# - {os: debian, codename: bookworm, image_owner: arm64v8/, labels: [ubuntu-24.04-arm]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: vcpkg - linux | ${{ matrix.image_owner }}
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@main
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci cmake git curl zip unzip tar nodejs pkg-config
- name: git clone
uses: myci-actions/checkout@main
- name: install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git vcpkg-installation
(cd vcpkg-installation; ./bootstrap-vcpkg.sh)
- name: set VCPKG_ROOT
uses: myci-actions/export-env-var@main
with: {name: VCPKG_ROOT, value: "$(pwd)/vcpkg-installation"}
- name: add VCPKG_ROOT to PATH
uses: myci-actions/export-env-var@main
with: {name: PATH, value: "$PATH:$VCPKG_ROOT"}
- name: prepare vcpkg port
run: |
myci-vcpkg-prepare.sh --git-ref ${{ github.sha }}
- name: test vcpkg port
run: |
cd build/vcpkg/test
cmake .
make
./test
- name: upload vcpkg logs to artifacts
if: always() # even if previous steps fail, this one needs to be run
uses: actions/upload-artifact@v4
with:
name: vcpkg_linux-logs
path: |
vcpkg-installation/buildtrees/${{ env.PACKAGE_NAME }}/
build/vcpkg/**/*.log
- name: deploy vcpkg port
run: |
myci-deploy-vcpkg.sh --repo cppfw/vcpkg-repo --port-dir build/vcpkg/overlay/${PACKAGE_NAME}
if: startsWith(github.ref, 'refs/tags/')
##### vcpkg-windows #####
vcpkg-windows:
runs-on: windows-latest
defaults:
run:
shell: powershell
name: vcpkg - windows
steps:
- name: git clone
uses: actions/checkout@v4
- name: get myci scripts
uses: actions/checkout@v4
with:
repository: cppfw/myci
ref: latest
path: myci
- name: add myci to PATH
uses: myci-actions/export-env-var-powershell@main
with: {name: PATH, value: "$env:Path;myci/src/powershell"}
- name: set VCPKG_ROOT
uses: myci-actions/export-env-var-powershell@main
# accorging to github actions windows image docs, it should define VCPKG_INSTALLATION_ROOT env var,
# but on practice it is not set, so specify vcpkg root path explicitly
with: {name: VCPKG_ROOT, value: "C:/vcpkg/"}
- name: make local symbolic link to VCPKG installation directory
# this is needed at least for actions/upload-artifact to be able to find vcpkg install logs
shell: powershell
run: New-Item -ItemType SymbolicLink -Path vcpkg-installation -Target $env:VCPKG_ROOT
- name: prepare vcpkg port
run: myci-vcpkg-prepare.ps1 -gitref ${{ github.sha }}
- name: test vcpkg port
run: |
cd build/vcpkg/test
cmake .
cmake --build . --parallel
./Debug/test.exe
- name: upload vcpkg logs to artifacts
if: always() # even if previous steps fail, this one needs to be run
uses: actions/upload-artifact@v4
with:
name: vcpkg_windows_logs
path: |
vcpkg-installation/buildtrees/${{ env.PACKAGE_NAME }}/
build/vcpkg/**/*.log
##### vcpkg-ios #####
vcpkg-ios:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
config:
- Debug
- Release
name: vcpkg - ios | ${{ matrix.config }}
steps:
- name: workaround python2 and python3 issue when upgrading python
run : |
rm -rf /usr/local/bin/2to3*
rm -rf /usr/local/bin/idle3*
rm -rf /usr/local/bin/pydoc3*
rm -rf /usr/local/bin/python3
rm -rf /usr/local/bin/python3-config
rm -rf /usr/local/bin/python3*
rm -rf /usr/local/bin/python3*-config
- name: git clone
uses: myci-actions/checkout@main
with:
submodules: true # non-recursive, no remote
- name: install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git vcpkg-installation
(cd vcpkg-installation; ./bootstrap-vcpkg.sh)
- name: set VCPKG_ROOT
uses: myci-actions/export-env-var@main
with: {name: VCPKG_ROOT, value: "$(pwd)/vcpkg-installation"}
- name: add VCPKG_ROOT to PATH
uses: myci-actions/export-env-var@main
with: {name: PATH, value: "$PATH:$VCPKG_ROOT"}
- name: add cppfw tap
run: |
brew tap cppfw/tap
brew update
- name: install ci tools
run: brew install myci cmake
- name: prepare vcpkg port
run: |
myci-vcpkg-prepare.sh --git-ref ${{ github.sha }}
- name: test vcpkg port
run: |
cd build/vcpkg/test
cmake -G Xcode -D CMAKE_SYSTEM_NAME=iOS -D VCPKG_TARGET_TRIPLET=arm64-ios-simulator .
cmake --build . --parallel --config ${{ matrix.config }} -- -sdk iphonesimulator -arch arm64
# ./test
- name: upload vcpkg logs to artifacts
if: always() # even if previous steps fail, this one needs to be run
uses: actions/upload-artifact@v4
with:
name: vcpkg_ios_${{ matrix.config }}_logs
path: |
vcpkg-installation/buildtrees/${{ env.PACKAGE_NAME }}/
build/vcpkg/**/*.log
##### conan - linux #####
conan-linux:
strategy:
fail-fast: false
matrix:
include:
- {os: debian, codename: bookworm, image_owner: }
# - {os: debian, codename: bookworm, image_owner: i386/, labels: [i386,docker]}
# - {os: debian, codename: bookworm, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]}
# - {os: debian, codename: bookworm, image_owner: arm64v8/, labels: [ubuntu-24.04-arm]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: conan - linux | ${{ matrix.image_owner }}
steps:
# - name: add llvm repo (for clang-format)
# uses: myci-actions/add-deb-repo@main
# with:
# repo: deb http://apt.llvm.org/${{ matrix.codename }} llvm-toolchain-${{ matrix.codename }} main
# repo-name: llvm
# keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
# install: clang-format clang-tidy
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@main
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: devscripts equivs myci pipx cmake git
- name: add ~/.local/bin to PATH
uses: myci-actions/export-env-var@main
with: {name: PATH, value: "$PATH:$HOME/.local/bin"}
- name: install conan
run: pipx install conan
- name: create default conan profile
run: |
conan profile detect --name default
sed -i -E "s/compiler.cppstd=.*$/compiler.cppstd=17/g" ~/.conan2/profiles/default
- name: git clone
uses: myci-actions/checkout@main
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@main
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh)}
if: startsWith(github.ref, 'refs/tags/')
- name: build
run: |
conan remote add cppfw $MYCI_CONAN_REMOTE
conan create build/conan --build=missing --user $MYCI_CONAN_USER --channel main --version $PACKAGE_VERSION
- name: deploy conan package
run: |
conan remote login --password $MYCI_CONAN_PASSWORD cppfw $MYCI_CONAN_USER
conan upload --check --remote cppfw $PACKAGE_NAME/$PACKAGE_VERSION@$MYCI_CONAN_USER/main
if: startsWith(github.ref, 'refs/tags/')
##### conan - macosx #####
conan-macosx:
strategy:
fail-fast: false
matrix:
os:
# - macos-10.15
# - macos-11
# - macos-12
- macos-latest
name: conan - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: workaround python2 and python3 issue when upgrading python
run : |
rm -rf /usr/local/bin/2to3*
rm -rf /usr/local/bin/idle3*
rm -rf /usr/local/bin/pydoc3*
rm -rf /usr/local/bin/python3
rm -rf /usr/local/bin/python3-config
rm -rf /usr/local/bin/python3*
rm -rf /usr/local/bin/python3*-config
- name: install clang-tidy and clang-format
run: |
brew install llvm
ln -s "$(brew --prefix llvm)/bin/clang-format" "/usr/local/bin/clang-format"
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"
ln -s "$(brew --prefix llvm)/bin/clang-apply-replacements" "/usr/local/bin/clang-apply-replacements"
- name: git clone
uses: myci-actions/checkout@main
- name: add cppfw tap
run: |
brew tap cppfw/tap
brew update
- name: install ci tools
run: brew install myci conan
- name: create default conan profile
run: |
conan profile detect --name default
sed -i -E "s/compiler.cppstd=.*$/compiler.cppstd=17/g" ~/.conan2/profiles/default
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@main
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh)}
if: startsWith(github.ref, 'refs/tags/')
- name: build
run: |
conan remote add cppfw $MYCI_CONAN_REMOTE
conan create build/conan --build=missing --user $MYCI_CONAN_USER --channel main --version $PACKAGE_VERSION
- name: deploy conan package
run: |
conan remote login --password $MYCI_CONAN_PASSWORD cppfw $MYCI_CONAN_USER
conan upload --check --remote cppfw $PACKAGE_NAME/$PACKAGE_VERSION@$MYCI_CONAN_USER/main
if: startsWith(github.ref, 'refs/tags/')
##### conan - emscripten #####
conan-emscripten:
strategy:
fail-fast: false
matrix:
include:
# - {os: ubuntu, codename: noble, image_owner: }
- {os: debian, codename: bookworm, image_owner: }
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: conan - emscripten | ${{ matrix.labels[0] }}
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@main
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: devscripts equivs myci pipx cmake git nodejs
- name: add ~/.local/bin to PATH
uses: myci-actions/export-env-var@main
with: {name: PATH, value: "$PATH:$HOME/.local/bin"}
- name: install conan
run: pipx install conan
- name: create default conan profile
run: |
conan profile detect --name default
sed -i -E "s/compiler.cppstd=.*$/compiler.cppstd=17/g" ~/.conan2/profiles/default
- name: git clone
uses: myci-actions/checkout@main
with:
submodules: false
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@main
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh)}
if: startsWith(github.ref, 'refs/tags/')
- name: build
run: |
conan remote add cppfw $MYCI_CONAN_REMOTE
# NOTE: specifying empty test folder to skip the test stage
conan create build/conan --profile:build default --profile:host build/emscripten/conan.profile --build=missing --user $MYCI_CONAN_USER --channel main --version $PACKAGE_VERSION --test-folder ""
- name: deploy conan package
run: |
conan remote login --password $MYCI_CONAN_PASSWORD cppfw $MYCI_CONAN_USER
conan upload --check --remote cppfw $PACKAGE_NAME/$PACKAGE_VERSION@$MYCI_CONAN_USER/main
if: startsWith(github.ref, 'refs/tags/')