forked from sony/nmos-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-test.yml
More file actions
176 lines (158 loc) · 6.77 KB
/
build-test.yml
File metadata and controls
176 lines (158 loc) · 6.77 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
@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 }}
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}})'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]
install_mdns: [false, true]
use_conan: [true]
force_cpprest_asio: [false]
dns_sd_mode: [multicast, unicast]
exclude:
# install_mdns is only meaningful on Linux
- os: macos-11
install_mdns: true
- os: windows-2019
install_mdns: true
# for now, unicast DNS-SD tests are only implemented on Linux
- os: macos-11
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
include:
- os: windows-2019
install_mdns: false
use_conan: true
force_cpprest_asio: true
dns_sd_mode: multicast
- os: ubuntu-22.04
install_mdns: false
use_conan: true
force_cpprest_asio: false
dns_sd_mode: multicast
steps:
- uses: actions/checkout@v2
- 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
echo "GITHUB_WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV
echo "RUNNER_WORKSPACE=${{ runner.workspace }}" >> $GITHUB_ENV
- name: install python
uses: actions/setup-python@v1
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}})'
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]
steps:
- uses: actions/checkout@v2
- 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
curl -sS https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz | tar -xJ
cd Python-3.6.9
./configure
make -j8
make install
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.6 3
ln -s /usr/local/bin/python3.6 /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@v2
- 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/download-artifact@v2.0
with:
path: ${{ runner.workspace }}/artifacts
- name: make badges
run: |
# combine badges from all builds, exclude macos-11
${{ github.workspace }}/Sandbox/make_badges.sh ${{ github.workspace }} ${{ runner.workspace }}/artifacts macos-11
# 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 'test-results-uploader@nmos-cpp.iam.gserviceaccount.com'
git commit -qm "Badges for README at ${{ env.GITHUB_COMMIT }}"
git push -f `git remote` badges-${{ env.GITHUB_COMMIT }}:badges