-
Notifications
You must be signed in to change notification settings - Fork 0
208 lines (203 loc) · 7.03 KB
/
release-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
name: release-tests
# Run automated part of the tests specified by the release specs (see
# https://github.com/RIOT-OS/Release-Specs/) on `native` and IoT-LAB boards.
#
# It is split into `native` tests and IoT-LAB tests, as the tests are
# resource-wise disjunct and thus can be run parallel. For each IoT-LAB board
# test an IoT-LAB experiment is started using the `rici` account.
#
# This workflow is run periodically on master with a cron job, on new pushed
# release candidates tags and release tags, and can be triggered via workflow
# dispatch.
on:
schedule:
- cron: '0 3 * * 6'
push:
# Run on all new release candidates and release tags
tags:
- '[0-9][0-9][0-9][0-9].[0-9][0-9]-RC[0-9]*'
- '[0-9][0-9][0-9][0-9].[0-9][0-9]'
- '[0-9][0-9][0-9][0-9].[0-9][0-9].*'
workflow_dispatch:
inputs:
riot_version:
description: 'RIOT version to checkout'
required: true
default: 'master'
release_specs_version:
description: 'Release-Specs version to checkout'
required: true
default: 'master'
docker_version:
description: 'riot/riotbuild docker image version'
required: true
default: 'latest'
env:
DOCKER_MAKE_ARGS: -j
# split up native and IoT-LAB tasks to parallelize somewhat and prevent
# to hit Github Limit of 6h per job, can't use matrix because there seems to be
# some sync happening and the longer running job is killed.
jobs:
native-tasks:
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- name: Generate .riotgithubtoken
run: |
echo '${{ secrets.RIOT_CI_ACCESS_TOKEN }}' > ~/.riotgithubtoken
- name: Checkout Release-Specs
uses: actions/checkout@v2
with:
repository: RIOT-OS/Release-Specs
path: Release-Specs
fetch-depth: 1
ref: ${{ github.event.inputs.release_specs_version }}
- name: Checkout RIOT
uses: actions/checkout@v2
with:
repository: RIOT-OS/RIOT
path: RIOT
fetch-depth: 1
ref: ${{ github.event.inputs.riot_version }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox junit2html
- name: Pull riotbuild docker image
run: |
DOCKER_VERSION="${{ github.event.inputs.docker_version }}"
if [ -z "$DOCKER_VERSION" ]; then
DOCKER_VERSION="latest"
fi
docker pull riot/riotbuild:$DOCKER_VERSION
- name: Create TAP interfaces
run: |
sudo RIOT/dist/tools/tapsetup/tapsetup -c 11
- name: Run release tests
timeout-minutes: 350
run: |
RIOTBASE="$GITHUB_WORKSPACE/RIOT"
TOX_ARGS=""
if ! echo ${{ github.event.inputs.riot_version }} | \
grep -q "[0-9]\{4\}.[0-9]\{2\}-RC[0-9]\+"; then
TOX_ARGS+="--non-RC "
fi
cd Release-Specs
# definition in env does not work since $GITHUB_WORKSPACE seems not to
# be accessible
sudo \
BUILD_IN_DOCKER=1 \
DOCKER_MAKE_ARGS=${DOCKER_MAKE_ARGS} \
DOCKER_ENV_VARS=USEMODULE \
GITHUB_REPOSITORY=${GITHUB_REPOSITORY} \
GITHUB_RUN_ID=${GITHUB_RUN_ID} \
GITHUB_SERVER_URL=${GITHUB_SERVER_URL} \
RIOTBASE=${RIOTBASE} \
$(which tox) -- ${TOX_ARGS} -m "not iotlab_creds"
- name: junit2html and XML deploy
if: always()
run: |
DATE=$(date +"%Y-%m-%d-%H-%M-%S")
if echo ${{ github.event.inputs.riot_version }} | \
grep -q "[0-9]\{4\}.[0-9]\{2\}"; then
VER=${{ github.event.inputs.riot_version }}
else
VER=$(git -C $GITHUB_WORKSPACE/RIOT rev-parse --short HEAD)
fi
mkdir test-reports/
junit2html $GITHUB_WORKSPACE/Release-Specs/test-report.xml \
test-reports/test-report-native-$VER-$DATE.html
cp $GITHUB_WORKSPACE/Release-Specs/test-report.xml \
test-reports/test-report-native-$VER-$DATE.xml
- uses: actions/upload-artifact@v2
if: always()
with:
name: Test Reports
path: test-reports/*
iotlab-tasks:
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- name: Generate .riotgithubtoken
run: |
echo '${{ secrets.RIOT_CI_ACCESS_TOKEN }}' > ~/.riotgithubtoken
- name: Checkout Release-Specs
uses: actions/checkout@v2
with:
repository: RIOT-OS/Release-Specs
path: Release-Specs
fetch-depth: 1
ref: ${{ github.event.inputs.release_specs_version }}
- name: Checkout RIOT
uses: actions/checkout@v2
with:
repository: RIOT-OS/RIOT
path: RIOT
fetch-depth: 1
ref: ${{ github.event.inputs.riot_version }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox junit2html
- name: Pull riotbuild docker image
run: |
DOCKER_VERSION="${{ github.event.inputs.docker_version }}"
if [ -z "$DOCKER_VERSION" ]; then
DOCKER_VERSION="latest"
fi
docker pull riot/riotbuild:$DOCKER_VERSION
- name: Setup IoT-LAB credentials
run: |
echo '${{ secrets.IOTLABRC }}' > ~/.iotlabrc
- name: Setup SSH agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.IOTLAB_PRIVATE_KEY }}
- name: Fetch host key from IoT-LAB saclay site
run: |
IOTLAB_USER=$(cat ~/.iotlabrc | cut -f1 -d:)
ssh -oStrictHostKeyChecking=accept-new \
${IOTLAB_USER}@saclay.iot-lab.info exit
- name: Run release tests
timeout-minutes: 350
run: |
# definition in env does not work since $GITHUB_WORKSPACE seems not to
# be accessible
export RIOTBASE="$GITHUB_WORKSPACE/RIOT"
TOX_ARGS=""
if ! echo ${{ github.event.inputs.riot_version }} | \
grep -q "[0-9]\{4\}.[0-9]\{2\}-RC[0-9]\+"; then
TOX_ARGS+="--non-RC "
fi
cd Release-Specs
BUILD_IN_DOCKER=1 \
DOCKER_ENV_VARS=USEMODULE \
$(which tox) -- ${TOX_ARGS} -m "iotlab_creds"
- name: junit2html and XML deploy
if: always()
run: |
DATE=$(date +"%Y-%m-%d-%H-%M-%S")
if echo ${{ github.event.inputs.riot_version }} | \
grep -q "[0-9]\{4\}.[0-9]\{2\}"; then
VER=${{ github.event.inputs.riot_version }}
else
VER=$(git -C $GITHUB_WORKSPACE/RIOT rev-parse --short HEAD)
fi
mkdir test-reports/
junit2html $GITHUB_WORKSPACE/Release-Specs/test-report.xml \
test-reports/test-report-iotlab-$VER-$DATE.html
cp $GITHUB_WORKSPACE/Release-Specs/test-report.xml \
test-reports/test-report-iotlab-$VER-$DATE.xml
- uses: actions/upload-artifact@v2
if: always()
with:
name: Test Reports
path: test-reports/*