macOS build (develop) #1505
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: macOS build (develop) | |
on: | |
schedule: | |
- cron: '0 23 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
webots-build: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'test webots build') }} | |
strategy: | |
matrix: | |
os: [macos-14] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 15 | |
ref: develop | |
- name: Build Webots | |
run: | | |
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') }} | |
strategy: | |
matrix: | |
os: [macos-14] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 15 | |
ref: develop | |
- name: Install Webots Compilation Dependencies | |
run: | | |
# wget and cmake are already installed | |
pip install setuptools | |
npm install -g appdmg | |
brew install swig | |
- 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/libexec/java_home -v 16)" | |
export PATH=/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin/:$PATH | |
make distrib -j4 | |
- 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=$(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 distribution') }} | |
with: | |
name: build-${{ matrix.os }} | |
path: | | |
distribution/*.dmg | |
test-suite: | |
needs: build | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'test suite') }} | |
strategy: | |
matrix: | |
os: [macos-14] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: develop | |
- name: Download Artifacts | |
uses: actions/[email protected] | |
with: | |
name: build-${{ matrix.os }} | |
path: artifact | |
- name: Extract Webots | |
run: | | |
hdiutil mount artifact/webots-*.dmg | |
sudo cp -R /Volumes/Webots/Webots.app /Applications | |
hdiutil unmount /Volumes/Webots | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Test | |
run: | |
export WEBOTS_DISABLE_SAVE_SCREEN_PERSPECTIVE_ON_CLOSE=true | |
export WEBOTS_HOME=/Applications/Webots.app | |
# we currently can't run the test suite because of https://github.com/cyberbotics/webots/issues/2110 | |
# python tests/test_suite.py | |
delete-artifacts: | |
needs: [build, test-suite] | |
if: ${{ always() && !contains(github.event.pull_request.labels.*.name, 'test distribution') && !contains(github.event.pull_request.labels.*.name, 'test webots build') }} | |
strategy: | |
matrix: | |
os: [macos-14] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete artifacts | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: build-${{ matrix.os }} |