-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
211 lines (208 loc) · 8.07 KB
/
test_suite_linux.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
name: Linux build
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
schedule:
- cron: '0 23 * * *'
push:
tags:
- nightly_*
- R20*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
webots-build:
if: ${{ contains(github.event.pull_request.labels.*.name, 'test webots build') }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 15
- name: Install Webots Compilation Dependencies
run: |
sudo scripts/install/linux_compilation_dependencies.sh
- name: Build Webots
run: |
export LIBGL_ALWAYS_SOFTWARE=true
xvfb-run --auto-servernum make webots_target -j4
build:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'test distribution') || contains(github.event.pull_request.labels.*.name, 'test suite') || contains(github.event.pull_request.labels.*.name, 'test ros') || contains(github.event.pull_request.labels.*.name, 'test worlds') }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
include:
- os: ubuntu-20.04
JAVA_VERSION: "16"
ROS_DISTRO: "noetic"
- os: ubuntu-22.04
JAVA_VERSION: "18"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 15
- name: Install Webots Compilation Dependencies
run: |
sudo scripts/install/linux_optional_compilation_dependencies.sh
- name: Set Commit SHA in Version
if: ${{ github.event_name == 'schedule' }}
run: python scripts/packaging/set_commit_and_date_in_version.py $(git log -1 --format='%H')
- name: Webots Package Creation
run: |
export JAVA_HOME=/usr/lib/jvm/java-${{ matrix.JAVA_VERSION }}-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
export LIBGL_ALWAYS_SOFTWARE=true
export ROS_DISTRO=${{ matrix.ROS_DISTRO }}
xvfb-run --auto-servernum make distrib -j4
- name: Create/Update GitHub release
if: ${{ matrix.os == 'ubuntu-20.04' && (github.event_name == 'push' || github.event_name == 'schedule') }}
run: |
sudo python -m pip install requests PyGithub
pip install pyopenssl --upgrade
scripts/packaging/publish_release.py --key=${{ secrets.GITHUB_TOKEN }} --repo=${{ github.repository }} --branch=${{ github.ref }} --commit=$(git log -1 --format='%H') --tag=${{ github.ref }}
- uses: actions/upload-artifact@v3
if: ${{ contains(github.event.pull_request.labels.*.name, 'test suite') || contains(github.event.pull_request.labels.*.name, 'test ros') || contains(github.event.pull_request.labels.*.name, 'test worlds') }}
with:
name: build-${{ matrix.os }}
path: |
distribution/*.tar.bz2
distribution/*.zip
- uses: actions/upload-artifact@v3
if: ${{ !contains(github.event.pull_request.labels.*.name, 'test suite') && !contains(github.event.pull_request.labels.*.name, 'test ros') && !contains(github.event.pull_request.labels.*.name, 'test worlds') }}
with:
name: build-${{ matrix.os }}
path: |
distribution/*.tar.bz2
distribution/*.deb
distribution/*.zip
test-suite:
needs: build
if: ${{ contains(github.event.pull_request.labels.*.name, 'test suite') || github.event_name == 'schedule' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: build-ubuntu-20.04
path: artifact
- name: Extract Webots
run: tar xjf artifact/webots-*-x86-64*.tar.bz2 -C artifact
- name: Install Webots Dependencies
run: sudo scripts/install/linux_test_dependencies.sh --exclude-ros
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Test Suite
run: |
export LIBGL_ALWAYS_SOFTWARE=true
export WEBOTS_DISABLE_SAVE_SCREEN_PERSPECTIVE_ON_CLOSE=true
xvfb-run --auto-servernum python scripts/packaging/update_urls.py $(git log -1 --format='%H')
export WEBOTS_HOME=$PWD/artifact/webots
export TESTS_HOME=$PWD # required by cache group in the test suite
export BRANCH_HASH=$(git log -1 --format='%H')
xvfb-run --auto-servernum python tests/test_suite.py
- uses: actions/upload-artifact@v3
if: failure()
with:
name: test-results-${{ matrix.os }}
path: |
tests/
test-ros:
needs: build
if: ${{ contains(github.event.pull_request.labels.*.name, 'test ros') || github.event_name == 'schedule' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
include:
- os: ubuntu-20.04
ROS_DISTRO: noetic
python: 3.8
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: build-${{ matrix.os }}
path: artifact
- name: Extract Webots
run: tar xjf artifact/webots-*-x86-64*.tar.bz2 -C artifact
- name: Install Webots Dependencies
run: sudo scripts/install/linux_test_dependencies.sh
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Run Test
run: |
export WEBOTS_HOME=$PWD/artifact/webots
export ROS_DISTRO=${{ matrix.ROS_DISTRO }}
python -m pip install rospkg catkin_pkg empy defusedxml netifaces
Xvfb :99 &
export DISPLAY=:99
./tests/ros.sh
timeout-minutes: 15
test-worlds:
needs: build
if: ${{ contains(github.event.pull_request.labels.*.name, 'test worlds') || github.event_name == 'schedule' }}
runs-on: ubuntu-20.04
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: build-ubuntu-20.04
path: artifact
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7.0.7
- name: Extract Webots and Cache
run: |
tar xjf artifact/webots-*-x86-64*.tar.bz2 -C artifact
cp -R artifact/ untouched-artifact/
mkdir -p ~/.cache/Cyberbotics/Webots/
unzip -q artifact/assets-*.zip -d ~/.cache/Cyberbotics/Webots/assets
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Update World, Check Warnings and Validate Cache
run: |
wget https://raw.githubusercontent.com/cyberbotics/webots/${{ steps.branch-name.outputs.current_branch }}/scripts/install/linux_runtime_dependencies.sh && sudo bash linux_runtime_dependencies.sh
export LIBGL_ALWAYS_SOFTWARE=true
export WEBOTS_DISABLE_SAVE_SCREEN_PERSPECTIVE_ON_CLOSE=true
export WEBOTS_HOME=$PWD/artifact/webots
wget https://raw.githubusercontent.com/cyberbotics/webots/${{ steps.branch-name.outputs.current_branch }}/tests/test_worlds.py
xvfb-run --auto-servernum python3 test_worlds.py
if [[ "$(diff -qr artifact/ untouched-artifact/ | wc -l)" -ne "0" ]]; then echo Some world and/or wbproj files are not up to date: "$(diff -qr artifact/ untouched-artifact/)"; exit 1; fi
delete-artifacts:
needs: [build, test-suite, test-ros, test-worlds]
if: ${{ always() && !contains(github.event.pull_request.labels.*.name, 'test distribution') && !contains(github.event.pull_request.labels.*.name, 'test webots build') }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ubuntu-latest
steps:
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: build-${{ matrix.os }}