-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (163 loc) · 7.09 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
name: ci
on:
push: {branches-ignore: [latest], tags: ['*']}
pull_request:
env:
PACKAGE_NAME: ${{ github.event.repository.name }}
PACKAGE_VERSION: ${{ github.sha }}
jobs:
##### coverage #####
coverage:
runs-on: ubuntu-latest
container: debian:bullseye
name: coverage - measure
env:
linux_distro: debian
linux_release: bullseye
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
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
- name: add llvm repo (for clang-format)
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://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: install ci tools
run: |
apt --quiet install --assume-yes devscripts equivs python3-pip
# install gcovr >5.2
pip install git+https://github.com/gcovr/gcovr.git
- name: git clone
uses: myci-actions/checkout@master
- name: prepare debian package
run: myci-deb-prepare.sh
- name: install deps
run: myci-deb-install-build-deps.sh
- name: build
run: make config=gcov
- name: test
run: make config=gcov test
- name: generate coverage report
run: gcovr --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@v4
if: always() # even if previous steps fail, this one needs to be run
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cobertura.xml
# flags: unittests # optional
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: bullseye, image_owner: }
# - {os: debian, codename: bullseye, image_owner: arm32v7/, labels: [arm,docker]}
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 }}
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
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 locales git
- name: add llvm repo (for clang-format)
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://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 --quiet install --assume-yes devscripts equivs
- name: git clone
uses: myci-actions/checkout@master
- 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
##### deb linux #####
deb:
strategy:
fail-fast: false
matrix:
include:
- {os: debian, codename: bullseye, image_owner: }
# - {os: debian, codename: bullseye, image_owner: i386/, labels: [i386,docker]}
- {os: debian, codename: bullseye, image_owner: arm32v7/, labels: [arm,docker]}
- {os: debian, codename: bullseye, image_owner: arm64v8/, labels: [arm64,docker]}
- {os: debian, codename: bookworm, image_owner: }
# - {os: debian, codename: bookworm, image_owner: i386/, labels: [i386,docker]}
- {os: debian, codename: bookworm, image_owner: arm32v7/, labels: [arm,docker]}
- {os: debian, codename: bookworm, image_owner: arm64v8/, labels: [arm64,docker]}
# - {os: ubuntu, codename: focal, image_owner: }
- {os: ubuntu, codename: jammy, image_owner: }
- {os: raspbian, codename: bullseye, image_owner: igagis/, labels: [arm,docker]}
- {os: raspbian, codename: bookworm, image_owner: igagis/, labels: [arm,docker]}
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: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
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 locales git
- name: add llvm repo (for clang-format)
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://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: |
# 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
apt --quiet install --assume-yes devscripts equivs
- name: git clone
uses: myci-actions/checkout@master
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
- name: prepare debian package
run: myci-deb-prepare.sh
- name: install deps
run: myci-deb-install-build-deps.sh
- name: build
run: dpkg-buildpackage --unsigned-source --unsigned-changes
# - name: upload binaries to artifacts
# uses: actions/[email protected]
# with:
# name: binaries-${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
# path: |
# src/out/rel/*.so.*
# src/out/rel/*.a
- 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 gagistech/${{ matrix.os }} --distro ${{ matrix.codename }} --component main ../*_${PACKAGE_VERSION}_*.deb
if: startsWith(github.ref, 'refs/tags/')