forked from cyberbotics/webots
-
Notifications
You must be signed in to change notification settings - Fork 3
112 lines (110 loc) · 4.72 KB
/
test_suite_mac_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
name: Test Suite macOS (develop)
on:
schedule:
- cron: '0 23 * * *'
jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.3.0
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 world update') }}
strategy:
matrix:
os: [macos-10.15]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 15
ref: develop
- name: Install Webots Compilation Dependencies
run: |
brew install swig wget cmake python@3.7 python@3.8 python@3.9
npm install -g appdmg
# install regular Python 3.7
sudo mkdir -p /Library/Frameworks/Python.framework/Versions/3.7
wget -qq https://cyberbotics.com/files/repository/dependencies/mac/release/python3.7.zip -P dependencies
sudo unzip -o -q dependencies/python3.7.zip -d /Library/Frameworks/Python.framework/Versions/3.7
# install regular Python 3.8
sudo mkdir -p /Library/Frameworks/Python.framework/Versions/3.8
wget -qq https://cyberbotics.com/files/repository/dependencies/mac/release/python3.8.zip -P dependencies
sudo unzip -o -q dependencies/python3.8.zip -d /Library/Frameworks/Python.framework/Versions/3.8
# install regular Python 3.9
sudo mkdir -p /Library/Frameworks/Python.framework/Versions/3.9
wget -qq https://cyberbotics.com/files/repository/dependencies/mac/release/python3.9.zip -P dependencies
sudo unzip -o -q dependencies/python3.9.zip -d /Library/Frameworks/Python.framework/Versions/3.9
- 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/libexec/java_home -v 16)"
export PATH=/Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin/:$PATH
make distrib -j4
- name: Prepare Webots Controller Deployment
if: ${{ github.event_name == 'schedule' }}
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.WEBOTS_CONTROLLER_DEPLOY_KEY }}
- name: Deploy Webots Controller
if: ${{ github.event_name == 'schedule' }}
run: scripts/packaging/sync_controller_lib.sh
- 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 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-10.15]
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: |
hdiutil mount artifact/webots-*.dmg
sudo cp -R /Volumes/Webots/Webots.app /Applications
hdiutil unmount /Volumes/Webots
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- 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') }}
strategy:
matrix:
os: [macos-10.15]
runs-on: ubuntu-latest
steps:
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: build-${{ matrix.os }}