nightly windows🌃 #953
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 windows🌃 | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 2 * * *' # run at 2 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 "::set-output name=should_run::false" | |
windows-build: | |
#needs: check_date | |
#if: ${{ needs.check_date.outputs.should_run != 'false' }} | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
include: | |
- PLATFORM: 'windows-64' | |
PYTHON_ARCH: 'x64' | |
VS_ARCH: 'amd64' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: Set up Python 3.11.3 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11.3" | |
- name: Init submodule | |
run: | | |
git submodule init | |
git submodule update | |
- name: Cache py4godot and build directories | |
uses: actions/cache@v3 | |
with: | |
path: | | |
py4godot | |
build | |
key: ${{ runner.os }}-checkout-${{ hashFiles('**/generate_classes.py', '**/generate_pxd_bridge.py', '**/extension_api.json') }} | |
restore-keys: | | |
${{ runner.os }}-checkout- | |
- name: Sync file timestamps | |
shell: bash | |
run: | | |
# Function to sync timestamps | |
sync_timestamps() { | |
local dir=$1 | |
local extension=$2 | |
if [ -d "$dir" ]; then | |
find "$dir" -name "*.$extension" | while read src_file; do | |
for target_ext in cpp pxd; do | |
target_file="${src_file%.$extension}.$target_ext" | |
if [ -f "$target_file" ]; then | |
touch -r "$src_file" "$target_file" | |
fi | |
done | |
done | |
else | |
echo "Directory $dir not found. Skipping timestamp sync for *.$extension files." | |
fi | |
} | |
# Sync .pyx files | |
sync_timestamps "py4godot" "pyx" | |
sync_timestamps "classes" "pyx" | |
# Sync standalone .pxd files | |
sync_timestamps "py4godot" "pxd" | |
sync_timestamps "classes" "pxd" | |
echo "File timestamp synchronization completed." | |
- name: Install Mesa | |
shell: cmd | |
run: | | |
mkdir godot | |
curl.exe -L --output godot/mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/20.3.2/mesa3d-20.3.2-release-msvc.7z | |
"C:\Program Files\7-Zip\7z.exe" x godot/mesa.7z -ogodot | |
cd godot | |
mklink opengl32.dll "x64\opengl32.dll" | |
mklink libglapi.dll "x64\libglapi.dll" | |
- name: Print structure | |
run: python meson_scripts/print_tools.py | |
- name: Install dependencies | |
run: | | |
python -m pip install -r requirements.txt | |
python -m pip install flake8 | |
#- name: Lint with flake8 | |
# run: | | |
# stop the build if there are Python syntax errors or undefined names | |
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
#flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Generate cast helpers | |
run: python meson_scripts/generate_cast_helpers.py | |
- name: Generate files | |
run: python generate.py | |
- name: Cythonize dev | |
run: python dev_cythonize_files.py | |
- name: Build | |
run: python build.py --target_platform=windows64 --compiler=gcc -create_plugin=False -buildtype=release | |
- name: Print structure | |
run: python meson_scripts/print_tools.py |