-
Notifications
You must be signed in to change notification settings - Fork 130
201 lines (184 loc) · 6.3 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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
DEB_PKGS: >-
g++ meson appstream gettext libgoogle-glog-dev libgtk-3-dev libglib2.0-dev
libjsoncpp-dev libsigc++-2.0-dev libayatana-appindicator3-dev
DEB_TEST_PKGS: xvfb
MAC_PKGS: >-
meson appstream gettext glog gtk+3 jsoncpp gtk-mac-integration libsigc++@2
jobs:
build-on-mac:
strategy:
matrix:
runs-on: [macos-latest]
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v2
- name: Configure Homebrew cache
uses: actions/cache@v2
with:
path: |
~/Library/Caches/Homebrew
key: ${{ runner.os }}-v1
- name: brew install
run: >-
brew install --display-times ${{ env.MAC_PKGS }}
- name: meson
run: meson setup build
- name: build
run: meson compile -C build
- name: install
run: meson install -C build
- name: test
run: |
sudo ifconfig lo0 alias 127.0.0.2 up
sudo ifconfig lo0 alias 127.0.0.3 up
sudo ifconfig lo0 alias 127.0.0.4 up
meson test -C build --verbose --no-stdsplit
build-on-linux:
strategy:
matrix:
runs-on: [ubuntu-20.04, ubuntu-22.04]
compiler: [g++, clang++]
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v2
- name: apt install
run: >-
sudo apt update &&
sudo apt install libunwind-dev &&
sudo apt install -y ${{ env.DEB_PKGS }} ${{ env.DEB_TEST_PKGS }}
- name: meson
run: |
meson --version
meson setup build
env:
CXX: ${{ matrix.compiler }}
- name: build
run: ninja -v -C build
- name: install
run: sudo meson install -C build
- name: test
run: |
xvfb-run -a meson test -C build --verbose --no-stdsplit
codecov:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: apt install
run: >-
sudo apt update &&
sudo apt install -y lcov ${{ env.DEB_PKGS }} ${{ env.DEB_TEST_PKGS }}
- name: meson
run: meson setup -D b_coverage=true build
- name: build
run: ninja -v -C build
- name: install
run: sudo meson install -C build
- name: test
run: |
xvfb-run -a meson test -C build --verbose --no-stdsplit
- name: lcov
run: |
lcov --directory . --capture --output-file coverage.info; # capture coverage info
lcov --remove coverage.info '/usr/*' --output-file coverage.info; # filter out system
lcov --remove coverage.info '*Test*' --output-file coverage.info; # filter out system
lcov --remove coverage.info '*gtest*' --output-file coverage.info; # filter out system
lcov --list coverage.info; #debug info
# https://docs.codecov.com/docs/quick-start
- name: "Upload coverage reports to Codecov"
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: true # optional (default = false)
verbose: false # optional (default = false)
build_job:
# The host should always be linux
runs-on: ubuntu-20.04
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
# Run steps on a matrix of 3 arch/distro combinations
strategy:
matrix:
include:
- arch: aarch64
distro: ubuntu22.04
- arch: ppc64le
distro: ubuntu22.04
#- arch: s390x
# distro: ubuntu20.04
- arch: armv7
distro: ubuntu22.04
#- arch: armv7
# distro: bookworm
steps:
- uses: actions/[email protected]
- uses: uraimo/run-on-arch-action@v2
name: Build artifact
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
# Not required, but speeds up builds
githubToken: ${{ github.token }}
# Create an artifacts directory
setup: |
mkdir -p "${PWD}/artifacts"
# Mount the artifacts directory as /artifacts in the container
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
# Pass some environment variables to the container
env: | # YAML, but pipe character is necessary
artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }}
# The shell to run commands with in the container
shell: /bin/sh
# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
install: |
apt-get update -q -y
apt-get install -q -y ${{ env.DEB_PKGS }} ${{ env.DEB_TEST_PKGS }}
# Produce a binary artifact and place it in the mounted volume
run: |
meson setup build
ninja -C build
meson install -C build
xvfb-run -a meson test -C build --verbose --no-stdsplit
# - name: Show the artifact
# # Items placed in /artifacts in the container will be in
# # ${PWD}/artifacts on the host.
# run: |
# ls -al "${PWD}/artifacts"
build-santize-address:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: apt install
run: >-
sudo apt update &&
sudo apt install libunwind-dev &&
sudo apt install -y ${{ env.DEB_PKGS }} ${{ env.DEB_TEST_PKGS }}
- name: meson
run: |
meson --version
meson setup build -Dsanitize-address=true
env:
CXX: g++
- name: build
run: ninja -v -C build
- name: install
run: sudo meson install -C build
- name: test
run: |
if ! xvfb-run -a meson test -C build --verbose --no-stdsplit; then
echo "::warning title=test-failed::test failed"
fi
continue-on-error: true