-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
166 lines (163 loc) · 6.29 KB
/
test_suite_linux_develop.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
name: Linux build (develop)
on:
schedule:
- cron: '0 23 * * *'
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-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 15
ref: develop
- 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 worlds') }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
include:
- os: ubuntu-22.04
JAVA_VERSION: "18"
- os: ubuntu-24.04
JAVA_VERSION: "21"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 15
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 $(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
xvfb-run --auto-servernum make distrib -j4
- name: Create/Update GitHub release
if: ${{ matrix.os == 'ubuntu-22.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@v4
if: ${{ contains(github.event.pull_request.labels.*.name, 'test suite') || contains(github.event.pull_request.labels.*.name, 'test worlds') }}
with:
name: build-${{ matrix.os }}
path: |
distribution/*.tar.bz2
distribution/*.zip
- uses: actions/upload-artifact@v4
if: ${{ !contains(github.event.pull_request.labels.*.name, 'test suite') && !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-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
ref: develop
- name: Download Artifacts
uses: actions/[email protected]
with:
name: build-ubuntu-22.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
- 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
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
test-worlds:
needs: build
if: ${{ contains(github.event.pull_request.labels.*.name, 'test worlds') || github.event_name == 'schedule' }}
runs-on: ubuntu-22.04
steps:
- name: Download Scripts
uses: actions/checkout@v4
with:
sparse-checkout: |
scripts/install/linux_runtime_dependencies.sh
tests/test_worlds.py
sparse-checkout-cone-mode: false
- name: Download Artifacts
uses: actions/[email protected]
with:
name: build-ubuntu-22.04
path: artifact
- 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@v2
with:
python-version: 3.9
- name: Update World, Check Warnings and Validate Cache
run: |
sudo bash scripts/install/linux_runtime_dependencies.sh
export LIBGL_ALWAYS_SOFTWARE=true
export WEBOTS_DISABLE_SAVE_SCREEN_PERSPECTIVE_ON_CLOSE=true
export WEBOTS_HOME=$PWD/artifact/webots
xvfb-run --auto-servernum python3 tests/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-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-22.04, ubuntu-24.04]
runs-on: ubuntu-latest
steps:
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: build-${{ matrix.os }}