-
Notifications
You must be signed in to change notification settings - Fork 80
/
build-test.yml
220 lines (201 loc) · 8.61 KB
/
build-test.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
@import header
name: 'build-test'
on: [pull_request, push]
# secrets:
# * GOOGLE_CREDENTIALS - base64 encoded google service account credentials, must be a single line with no whitespace
# * RESULTS_SHEET_ID - google sheets id of sheet to upload results to
env:
SECRET_GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
SECRET_RESULTS_SHEET_ID: ${{ secrets.RESULTS_SHEET_ID }}
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
jobs:
build_and_test:
name: '${{ matrix.os }}: build and test (install mdns: ${{ matrix.install_mdns }}, use conan: ${{ matrix.use_conan }}, force cpprest asio: ${{ matrix.force_cpprest_asio }}, dns-sd mode: ${{ matrix.dns_sd_mode}}, enable_authorization: ${{ matrix.enable_authorization }})'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-12, windows-2019]
install_mdns: [false, true]
use_conan: [true]
force_cpprest_asio: [false]
dns_sd_mode: [multicast, unicast]
enable_authorization: [false, true]
exclude:
# install_mdns is only meaningful on Linux
- os: macos-12
enable_authorization: false
- os: windows-2019
enable_authorization: false
- os: ubuntu-20.04
enable_authorization: false
- os: macos-12
install_mdns: true
- os: windows-2019
install_mdns: true
# for now, unicast DNS-SD tests are only implemented on Linux
- os: macos-12
dns_sd_mode: unicast
- os: windows-2019
dns_sd_mode: unicast
# for now, exclude unicast DNS-SD with mDNSResponder due to
# intermittent *** buffer overflow detected *** in mdnsd
- os: ubuntu-20.04
install_mdns: true
dns_sd_mode: unicast
enable_authorization: true
include:
- os: windows-2022
install_mdns: false
use_conan: true
force_cpprest_asio: true
dns_sd_mode: multicast
enable_authorization: true
- os: windows-2022
install_mdns: false
use_conan: true
force_cpprest_asio: true
dns_sd_mode: multicast
enable_authorization: false
- os: ubuntu-22.04
install_mdns: false
use_conan: true
force_cpprest_asio: false
dns_sd_mode: multicast
enable_authorization: true
- os: ubuntu-22.04
install_mdns: false
use_conan: true
force_cpprest_asio: false
dns_sd_mode: multicast
enable_authorization: false
steps:
- uses: actions/checkout@v3
- name: set environment variables
shell: bash
run: |
if [[ "${{ matrix.enable_authorization }}" == "true" ]]; then
authorization_mode=auth
else
authorization_mode=noauth
fi
if [[ "${{ runner.os }}" == "Linux" ]]; then
if [[ "${{ matrix.install_mdns }}" == "true" ]]; then
echo "BUILD_NAME=${{ matrix.os }}_mdns_${{ matrix.dns_sd_mode }}_$authorization_mode" >> $GITHUB_ENV
else
echo "BUILD_NAME=${{ matrix.os }}_avahi_${{ matrix.dns_sd_mode }}_$authorization_mode" >> $GITHUB_ENV
fi
elif [[ "${{ matrix.force_cpprest_asio }}" == "true" ]]; then
echo "BUILD_NAME=${{ matrix.os }}_asio_$authorization_mode" >> $GITHUB_ENV
else
echo "BUILD_NAME=${{ matrix.os }}_$authorization_mode" >> $GITHUB_ENV
fi
GITHUB_COMMIT=`echo "${{ github.sha }}" | cut -c1-7`
echo "GITHUB_COMMIT=$GITHUB_COMMIT" >> $GITHUB_ENV
echo "GITHUB_WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV
echo "RUNNER_WORKSPACE=${{ runner.workspace }}" >> $GITHUB_ENV
- name: install python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: install pip
run: |
python -m pip install --upgrade pip
@import build-and-test
build_and_test_ubuntu_14:
name: '${{ matrix.os }}: build and test (install mdns: ${{ matrix.install_mdns }}, use conan: ${{ matrix.use_conan }}, force cpprest asio: ${{ matrix.force_cpprest_asio }}, dns-sd mode: ${{ matrix.dns_sd_mode}}, enable_authorization: ${{ matrix.enable_authorization }})'
runs-on: ubuntu-20.04
container:
image: ubuntu:14.04
strategy:
fail-fast: false
matrix:
os: [ubuntu-14.04]
install_mdns: [true]
use_conan: [false]
force_cpprest_asio: [false]
dns_sd_mode: [multicast]
enable_authorization: [true]
steps:
- uses: actions/checkout@v3
- name: set environment variables
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
if [[ "${{ matrix.install_mdns }}" == "true" ]]; then
echo "BUILD_NAME=${{ matrix.os }}_mdns_${{ matrix.dns_sd_mode }}" >> $GITHUB_ENV
else
echo "BUILD_NAME=${{ matrix.os }}_avahi_${{ matrix.dns_sd_mode }}" >> $GITHUB_ENV
fi
elif [[ "${{ matrix.force_cpprest_asio }}" == "true" ]]; then
echo "BUILD_NAME=${{ matrix.os }}_asio" >> $GITHUB_ENV
else
echo "BUILD_NAME=${{ matrix.os }}" >> $GITHUB_ENV
fi
GITHUB_COMMIT=`echo "${{ github.sha }}" | cut -c1-7`
echo "GITHUB_COMMIT=$GITHUB_COMMIT" >> $GITHUB_ENV
# github.workspace points to the host path not the docker path, the home directory defaults to the workspace directory
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
cd ..
echo "RUNNER_WORKSPACE=`pwd`" >> $GITHUB_ENV
- name: install build tools
run: |
apt-get update -q
apt-get install -y software-properties-common
apt-get --allow-unauthenticated update -q
apt-get --allow-unauthenticated install -y curl g++ git make patch zlib1g-dev libssl-dev bsdmainutils dnsutils unzip
# ubuntu-14.04 ca-certificates are out of date
git config --global http.sslVerify false
# build and install openssl
curl -OsSkL https://openssl.org/source/old/1.1.1/openssl-1.1.1v.tar.gz
tar xzf openssl-1.1.1v.tar.gz
cd openssl-1.1.1v
./config --prefix=/usr/local/custom-openssl --libdir=lib --openssldir=/etc/ssl
make -j1 depend
make -j8
make install_sw
cd ..
# install ffi.h, which is required for python build
apt install libffi-dev
# build and install python
curl -sSk https://www.python.org/ftp/python/3.11.5/Python-3.11.5.tar.xz | tar -xJ
cd Python-3.11.5
./configure -C --with-openssl=/usr/local/custom-openssl --with-openssl-rpath=auto
make -j8
make install
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.11 3
ln -s /usr/local/bin/python3.11 /usr/bin/python
curl -sS https://bootstrap.pypa.io/pip/3.6/get-pip.py | python
curl -sS https://nodejs.org/dist/v12.16.2/node-v12.16.2-linux-x64.tar.xz | tar -xJ
echo "`pwd`/node-v12.16.2-linux-x64/bin" >> $GITHUB_PATH
@import build-and-test
make_badges:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: [build_and_test, build_and_test_ubuntu_14]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: set environment variables
shell: bash
run: |
GITHUB_COMMIT=`echo "${{ github.sha }}" | cut -c1-7`
echo "GITHUB_COMMIT=$GITHUB_COMMIT" >> $GITHUB_ENV
echo "GITHUB_WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV
echo "RUNNER_WORKSPACE=${{ runner.workspace }}" >> $GITHUB_ENV
- uses: actions/[email protected]
with:
path: ${{ runner.workspace }}/artifacts
- name: make badges
run: |
# combine badges from all builds, exclude macos-12
${{ github.workspace }}/Sandbox/make_badges.sh ${{ github.workspace }} ${{ runner.workspace }}/artifacts macos-12_auth macos-12_noauth
# force push to github onto an orphan 'badges' branch
cd ${{ github.workspace }}
git checkout --orphan badges-${{ env.GITHUB_COMMIT }}
git rm -rfq --ignore-unmatch .
git add *.svg
git remote set-url --push `git remote` https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git config --global user.name 'test-results-uploader'
git config --global user.email '[email protected]'
git commit -qm "Badges for README at ${{ env.GITHUB_COMMIT }}"
git push -f `git remote` badges-${{ env.GITHUB_COMMIT }}:badges