forked from cyberbotics/webots
-
Notifications
You must be signed in to change notification settings - Fork 0
181 lines (179 loc) · 6.81 KB
/
test_suite_linux_develop.yml
File metadata and controls
181 lines (179 loc) · 6.81 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
177
178
179
180
181
name: Test Suite Linux (develop)
on:
schedule:
- cron: '0 23 * * *'
defaults:
run:
shell: bash
jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
build:
needs: cleanup-runs
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 world update') }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
include:
- os: ubuntu-18.04
JAVA_VERSION: "11"
ROS_DISTRO: "melodic"
- os: ubuntu-20.04
JAVA_VERSION: "14"
ROS_DISTRO: "noetic"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
ref: develop
- 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 ${{ github.sha }}
- 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: Rename Webots Tarball Package
if: ${{ matrix.os == 'ubuntu-18.04' }}
run: |
sudo apt install --yes rename
rename 's/\.tar.bz2$/_ubuntu-18.04.tar.bz2/' distribution/*.tar.bz2
- name: Create/Update GitHub release
if: ${{ (github.event_name == 'push' || github.event_name == 'schedule') }}
run: |
sudo python -m pip install requests PyGithub
scripts/packaging/publish_release.py --key=${{ secrets.GITHUB_TOKEN }} --repo=${{ github.repository }} --branch=${{ github.ref }} --commit=${{ github.sha }} --tag=${{ github.ref }}
- uses: actions/upload-artifact@v2
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 world update') }}
with:
name: build-${{ matrix.os }}
path: |
distribution/*.tar.bz2
- uses: actions/upload-artifact@v2
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 world update') }}
with:
name: build-${{ matrix.os }}
path: |
distribution/*.tar.bz2
distribution/*.deb
test-suite:
needs: build
if: ${{ contains(github.event.pull_request.labels.*.name, 'test suite') || github.event_name == 'schedule' }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
ref: develop
- name: Download Artifacts
uses: actions/download-artifact@v2
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 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Test Suite
run: |
export LIBGL_ALWAYS_SOFTWARE=true
export WEBOTS_DISABLE_SAVE_SCREEN_PERSPECTIVE_ON_CLOSE=true
export WEBOTS_HOME=$PWD/artifact/webots
xvfb-run --auto-servernum python tests/test_suite.py
test-ros:
needs: build
if: ${{ contains(github.event.pull_request.labels.*.name, 'test ros') || github.event_name == 'schedule' }}
strategy:
matrix:
os: [ubuntu-18.04]
include:
- os: ubuntu-18.04
ROS_DISTRO: melodic
python: 2.7
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
ref: develop
- name: Download Artifacts
uses: actions/download-artifact@v2
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_runtime_dependencies.sh
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Setup ROS ${{ matrix.ROS_DISTRO }} environment
uses: ros-tooling/setup-ros@0.0.26
with:
required-ros-distributions: ${{ matrix.ROS_DISTRO }}
- 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
world-update:
needs: build
if: ${{ contains(github.event.pull_request.labels.*.name, 'test world update') || github.event_name == 'schedule' }}
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
ref: develop
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: build-ubuntu-18.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_runtime_dependencies.sh
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Update World
run: |
export LIBGL_ALWAYS_SOFTWARE=true
export WEBOTS_DISABLE_SAVE_SCREEN_PERSPECTIVE_ON_CLOSE=true
export WEBOTS_HOME=$PWD/artifact/webots
xvfb-run --auto-servernum python scripts/packaging/update_all_worlds.py
if [[ "$(git diff --name-only *.wbt *.wbproj | wc -l)" -ne "0" ]]; then echo Some world and/or wbproj files are not up to date: "$(git diff *.wbt *.wbproj)"; exit -1; fi
delete-artifacts:
needs: [build, test-suite, test-ros, world-update]
if: ${{ always() && !contains(github.event.pull_request.labels.*.name, 'test distribution') }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
runs-on: ubuntu-latest
steps:
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: build-${{ matrix.os }}