-
Notifications
You must be signed in to change notification settings - Fork 2k
137 lines (134 loc) · 4.9 KB
/
test-on-iotlab.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
name: test-on-iotlab
# Run 'compile_and_test_for_board.py' on IoT-LAB boards.
#
# This workflow will launch all tests on a list of IoT-LAB boards.
#
# This workflow is only run periodically on master with a cron and on new
# pushed release candidates tags.
on:
# Schedule weekly runs on Monday at 00:00 on master
schedule:
- cron: '00 0 * * 1'
push:
# Run on all new releases and release candidates 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].*'
# Allow manual trigger
workflow_dispatch:
inputs:
riot_version:
description: 'RIOT version to checkout'
required: true
default: 'master'
jobs:
# Runs all tests on IoT-LAB boards
compile_and_test_for_board:
strategy:
max-parallel: 8
fail-fast: false
matrix:
boards:
- riot: dwm1001
iotlab:
archi: dwm1001:dw1000
site: toulouse
- riot: iotlab-m3
iotlab:
archi: m3:at86rf231
site: saclay
- riot: nrf52dk
iotlab:
archi: nrf52dk:ble
site: saclay
- riot: nrf52840dk
iotlab:
archi: nrf52840dk:multi
site: saclay
- riot: nucleo-wl55jc
iotlab:
archi: nucleo-wl55jc:stm32wl
site: grenoble
- riot: samr21-xpro
iotlab:
archi: samr21:at86rf233
site: saclay
- riot: samr34-xpro
iotlab:
archi: samr34:sx1276
site: grenoble
- riot: b-l072z-lrwan1
iotlab:
archi: st-lrwan1:sx1276
site: saclay
- riot: b-l475e-iot01a
iotlab:
archi: st-iotnode:multi
site: saclay
runs-on: ubuntu-latest
name: ${{ matrix.boards.riot }}
env:
IOTLAB_NODE: auto
BUILD_IN_DOCKER: 1
COMPILE_AND_TEST_FOR_BOARD: ./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py
COMPILE_AND_TEST_ARGS: --with-test-only --jobs=2 --report-xml
# Exclude applications that are expected to fail or cannot run on iotlab
# - tests/periph/timer_short_relative_set is expected to fail
# - tests/riotboot requires the riotboot feature and provides a test
# but flashing at a specific offset is not (yet) supported on IoT-LAB
# so it will always fail because of that limitation
APPLICATIONS_EXCLUDE: tests/periph/timer_short_relative_set tests/riotboot
# Increase tolerance error with `tests/periph/timer_periodic` because
# of timing issues with the test script when running in the github
# actions environment
TEST_PERIPH_TIMER_PERIODIC_PRECISION: 0.30
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install iotlabcli pexpect riotctrl[rapidjson] junit-xml scapy
- name: Configure 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 ${{ matrix.boards.iotlab.site }} site
run: |
IOTLAB_USER=$(cat ~/.iotlabrc | cut -f1 -d:)
ssh -oStrictHostKeyChecking=accept-new \
${IOTLAB_USER}@${{ matrix.boards.iotlab.site }}.iot-lab.info exit
- name: Pull riotbuild docker image
run: |
docker pull riot/riotbuild:latest
- name: Checkout RIOT
uses: actions/checkout@main
with:
ref: ${{ github.event.inputs.riot_version }}
- name: Launch IoT-LAB experiment
run: |
IOTLAB_EXP_ID=$(iotlab-experiment --jmespath="id" submit \
-n "riot-ci-${{ matrix.boards.riot }}" -d 360 \
-l 1,site=${{ matrix.boards.iotlab.site }}+archi=${{ matrix.boards.iotlab.archi }})
iotlab-experiment wait -i ${IOTLAB_EXP_ID}
echo "IOTLAB_EXP_ID=${IOTLAB_EXP_ID}" >> $GITHUB_ENV
- name: Run compile_and_test_for_board.py on ${{ matrix.boards.riot }}
run: |
${COMPILE_AND_TEST_FOR_BOARD} . ${{ matrix.boards.riot }} \
results-${{ matrix.boards.riot }} ${COMPILE_AND_TEST_ARGS} \
--applications-exclude="${APPLICATIONS_EXCLUDE}"
- name: Stop IoT-LAB experiment
if: always()
run: iotlab-experiment stop -i ${IOTLAB_EXP_ID}
- name: Archive results
if: always()
# Store generated results-<riot board name> artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.boards.riot }}
path: results-${{ matrix.boards.riot }}