Skip to content

Add requirements.txt for _build_for_nightly.py #106

Add requirements.txt for _build_for_nightly.py

Add requirements.txt for _build_for_nightly.py #106

Workflow file for this run

name: Run Unit Tests
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
LINUX_64_TARGET: x86_64-unknown-linux-gnu
jobs:
build_linux_x86_64:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
glecs_lib: libglecs.so
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: πŸ™ Initialize submodules
run: git submodule update --init --recursive
- uses: Swatinem/rust-cache@v2
with:
workspaces: "./addons/glecs/rust/glecs"
cache-on-failure: true
- name: πŸ¦€ Update Rust
run: |
rustup update
rustup target add ${{ matrix.target }}
- name: πŸ¦€ Build Rust code
run: |
cargo build \
--release \
--manifest-path ./addons/glecs/rust/glecs/Cargo.toml \
--features compile_bindings \
--target-dir ./addons/glecs/bin \
--target ${{ matrix.target }}
# Copy library for use in test suite
cp -r ./addons/glecs/bin/${TARGET}/release ./addons/glecs/bin/debug
- name: πŸ€– Setup Godot
uses: chickensoft-games/setup-godot@v1
with:
# Version must include major, minor, and patch, and be >= 4.0.0
version: 4.2.1
# This shouldn't be needed because the important files from .godot are
# included, but we run the import process just in case.
- name: πŸ“§ Run Godot import
run: |
godot --headless --editor --quit-after 100
- name: ✏️ Run unittests
run: |
godot -s res://addons/gut/gut_cmdln.gd --headless -gdir="res://unittests" -gexit
- name: Cache compiled library
uses: actions/cache/[email protected]
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ./addons/glecs/bin/${{ matrix.target }}/release/${{ matrix.glecs_lib }}
# An explicit key for restoring and saving the cache
key: glecslib.${{ matrix.target }}
update_nightly:
needs: build_linux_x86_64
runs-on: windows-latest
steps:
# Run only if new commits were pushed
- name: πŸ“ Proceed if action is "push"
if: ${{ github.action }} != "push"
run: |
exit 0
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: false
- name: 🐧 Load compiled library, Linux x86_64
uses: actions/cache/[email protected]
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ./addons/glecs/bin/${{ env.LINUX_64_TARGET }}/release/libglecs.so
# An explicit key for restoring and saving the cache
key: glecslib.${{ env.LINUX_64_TARGET }}
# An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms
enableCrossOsArchive: true
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.11.2
cache: pip
- name: πŸš£β€β™‚οΈ Convert dev plugin to nightly format
run: |
cd addons/glecs
pip install regex
python _build_for_nightly.py
- name: πŸŒ™ Clone nightly branch
run: |
git clone https://github.com/${{ github.repository }} ../nightly_tmp -b nightly
mkdir ../nightly
mkdir ../nightly/.git
cp -r ../nightly_tmp/.git/* ../nightly/.git/
cp ../nightly_tmp/README.md ../nightly/README.md
cp ../nightly_tmp/.gitignore ../nightly/.gitignore
- name: πŸ–¨οΈ Copy dev branch plugin to nightly
run: |
cp -r -force ./addons/glecs/* ../nightly/
- name: add-and-commit
continue-on-error: true
run: |
cd ../nightly
git config --global user.name github-actions[bot]
git config --global user.email [email protected]
git add .
git commit --all -m "(AUTO) ${{ github.event.head_commit.message }}"
# Prevent error
echo ""
- name: πŸ“€ Push
if: steps.add-and-commit.outcome == 'success'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
branch: nightly
directory: ../nightly
- name: finish
run: exit 0
# nightly_unittests_linux_x86_64:
# needs: update_nightly
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: πŸ™ Checkout nightly branch
# run: |
# git fetch
# git branch nightly
# - name: πŸ€– Setup Godot
# uses: chickensoft-games/setup-godot@v1
# with:
# # Version must include major, minor, and patch, and be >= 4.0.0
# version: 4.2.1
# # This shouldn't be needed because the important files from .godot are
# # included, but we run the import process just in case.
# - name: πŸ“§ Run Godot import
# run: |
# godot --headless --editor --quit-after 100
# - name: ✏️ Run unittests
# run: |
# godot -s res://addons/gut/gut_cmdln.gd --headless -gdir="res://unittests" -gexit