nightly macOS🌃 #91
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: nightly macOS🌃 | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 3 * * *' # run at 3 AM UTC | |
jobs: | |
check_date: | |
runs-on: ubuntu-latest | |
name: Check latest commit | |
outputs: | |
should_run: ${{ steps.should_run.outputs.should_run }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: print latest_commit | |
run: echo ${{ github.sha }} | |
- id: should_run | |
continue-on-error: true | |
name: check latest commit is less than a day | |
if: ${{ github.event_name == 'schedule' }} | |
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "should_run=false" >> $GITHUB_OUTPUT | |
macos-build: | |
needs: check_date | |
if: ${{ needs.check_date.outputs.should_run != 'false' }} | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
include: | |
- PLATFORM: 'macos-64' | |
PYTHON_ARCH: 'x64' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: master | |
submodules: 'recursive' | |
- name: Set up Python 3.11.3 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11.3" | |
- name: Cache py4godot/classes directory | |
id: cache-py4godot-classes | |
uses: actions/cache@v3 | |
with: | |
path: py4godot/classes | |
key: ${{ runner.os }}-py4godot-classes-${{ hashFiles('**/generate_classes.py', '**/generate_pxd_bridge.py', '**/extension_api.json') }} | |
restore-keys: | | |
${{ runner.os }}-py4godot-classes- | |
- name: Run Python script and check result | |
shell: bash | |
run: | | |
set +e | |
python meson_scripts/does_cache_exist.py | |
exit_code=$? | |
if [ $exit_code -eq 0 ]; then | |
echo "Cache exists" | |
# Add any actions you want to take on success | |
else | |
echo "Cache does not exist" | |
exit 0 | |
fi | |
set -e | |
- name: Print variables | |
run: | | |
python meson_scripts/variables.py | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install -r requirements.txt | |
python -m pip install flake8 | |
- name: Print structure | |
run: python meson_scripts/print_tools.py | |
- name: Generate files | |
run: python generate.py -dev_build=True | |
- name: Conditional cythonize | |
shell: bash | |
run: | | |
set +e | |
python meson_scripts/does_cache_exist.py | |
exit_code=$? | |
set -e | |
if [ $exit_code -eq 0 ]; then | |
echo "Cache hit for py4godot/classes directory" | |
python cythonize_files.py -mode="cache" | |
else | |
echo "Cache miss for py4godot/classes directory" | |
python cythonize_files.py -mode="dev" | |
fi | |
- name: Build | |
run: python build.py --target_platform=darwin64 --compiler=clang -create_plugin=False -buildtype=release | |
- name: Create cache | |
run: python meson_scripts/create_cache.py | |
- name: Print structure | |
run: python meson_scripts/print_tools.py |