Linux build (develop) #719
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/download-artifact@v4.1.7 | |
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/download-artifact@v4.1.7 | |
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 }} |