-
Notifications
You must be signed in to change notification settings - Fork 8
105 lines (92 loc) · 2.89 KB
/
nightly-macos.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
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: 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