Skip to content

Commit d9caa65

Browse files
authored
Fix Worlds Test on Forked Repositories (#6702)
* fix test-worlds on forked repositories * remove workflow_dispatch trigger * use sparse-checkout * print WEBOTS_HOME * print WEBOTS_HOME directory * debugging prints * more prints * recheck directory listings after clone * dont clean workspace on checkout * download scripts first * remove debug prints
1 parent 52ce399 commit d9caa65

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

.github/workflows/test_suite_linux.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,18 @@ jobs:
170170
if: ${{ contains(github.event.pull_request.labels.*.name, 'test worlds') || github.event_name == 'schedule' }}
171171
runs-on: ubuntu-20.04
172172
steps:
173+
- name: Download Scripts
174+
uses: actions/checkout@v4
175+
with:
176+
sparse-checkout: |
177+
scripts/install/linux_runtime_dependencies.sh
178+
tests/test_worlds.py
179+
sparse-checkout-cone-mode: false
173180
- name: Download Artifacts
174181
uses: actions/[email protected]
175182
with:
176183
name: build-ubuntu-20.04
177184
path: artifact
178-
- name: Get branch name
179-
id: branch-name
180-
uses: tj-actions/[email protected]
181185
- name: Extract Webots and Cache
182186
run: |
183187
tar xjf artifact/webots-*-x86-64*.tar.bz2 -C artifact
@@ -190,12 +194,11 @@ jobs:
190194
python-version: 3.9
191195
- name: Update World, Check Warnings and Validate Cache
192196
run: |
193-
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
197+
sudo bash scripts/install/linux_runtime_dependencies.sh
194198
export LIBGL_ALWAYS_SOFTWARE=true
195199
export WEBOTS_DISABLE_SAVE_SCREEN_PERSPECTIVE_ON_CLOSE=true
196200
export WEBOTS_HOME=$PWD/artifact/webots
197-
wget https://raw.githubusercontent.com/cyberbotics/webots/${{ steps.branch-name.outputs.current_branch }}/tests/test_worlds.py
198-
xvfb-run --auto-servernum python3 test_worlds.py
201+
xvfb-run --auto-servernum python3 tests/test_worlds.py
199202
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
200203
delete-artifacts:
201204
needs: [build, test-suite, test-ros, test-worlds]

.github/workflows/test_suite_linux_develop.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,18 @@ jobs:
163163
if: ${{ contains(github.event.pull_request.labels.*.name, 'test worlds') || github.event_name == 'schedule' }}
164164
runs-on: ubuntu-20.04
165165
steps:
166+
- name: Download Scripts
167+
uses: actions/checkout@v4
168+
with:
169+
sparse-checkout: |
170+
scripts/install/linux_runtime_dependencies.sh
171+
tests/test_worlds.py
172+
sparse-checkout-cone-mode: false
166173
- name: Download Artifacts
167174
uses: actions/[email protected]
168175
with:
169176
name: build-ubuntu-20.04
170177
path: artifact
171-
- name: Get branch name
172-
id: branch-name
173-
uses: tj-actions/[email protected]
174178
- name: Extract Webots and Cache
175179
run: |
176180
tar xjf artifact/webots-*-x86-64*.tar.bz2 -C artifact
@@ -183,12 +187,11 @@ jobs:
183187
python-version: 3.9
184188
- name: Update World, Check Warnings and Validate Cache
185189
run: |
186-
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
190+
sudo bash scripts/install/linux_runtime_dependencies.sh
187191
export LIBGL_ALWAYS_SOFTWARE=true
188192
export WEBOTS_DISABLE_SAVE_SCREEN_PERSPECTIVE_ON_CLOSE=true
189193
export WEBOTS_HOME=$PWD/artifact/webots
190-
sudo apt install -y wget && wget https://raw.githubusercontent.com/cyberbotics/webots/${{ steps.branch-name.outputs.current_branch }}/tests/test_worlds.py
191-
xvfb-run --auto-servernum python3 test_worlds.py
194+
xvfb-run --auto-servernum python3 tests/test_worlds.py
192195
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
193196
delete-artifacts:
194197
needs: [build, test-suite, test-ros, test-worlds]

0 commit comments

Comments
 (0)