forked from RIOT-OS/RIOT
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (123 loc) · 4.27 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
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: iotlab-m3
iotlab:
archi: m3:at86rf231
site: saclay
- riot: nrf51dk
iotlab:
archi: nrf51dk:ble
site: saclay
- riot: nrf52dk
iotlab:
archi: nrf52dk:ble
site: saclay
- riot: nrf52840dk
iotlab:
archi: nrf52840dk:multi
site: saclay
- riot: nrf52832-mdk
iotlab:
archi: nrf52832mdk:ble
site: saclay
- riot: samr21-xpro
iotlab:
archi: samr21:at86rf233
site: saclay
- 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-ssh
BUILD_IN_DOCKER: 1
# Force .bin files generation because these files are used to flash on IoT-LAB and
# because compile_and_test_for_board forces RIOT_CI_BUILD which skip .bin
# files generation
DOCKER_ENVIRONMENT_CMDLINE: -e BUILD_FILES=\$$\(BINFILE\)
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
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install iotlabcli pexpect
- name: Configure credentials
run: echo '${{ secrets.IOTLABRC }}' > ~/.iotlabrc
- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.4.0
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@v2
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 "::set-env name=IOTLAB_EXP_ID::${IOTLAB_EXP_ID}"
- 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}
- 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@v2
with:
name: ${{ matrix.boards.riot }}
path: results-${{ matrix.boards.riot }}