Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 22 additions & 26 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
name: 🌌 Test Build

on: [pull_request]

# Make sure jobs cannot overlap (e.g. one from push and one from schedule).
concurrency:
group: pr-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-ci
cancel-in-progress: true
on:
workflow_call:

jobs:
build:
name: Build sources from the PR branch
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

# Configure the build environment.

# Configure the build environment.
- name: Install Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
# Runs 'bundle install' and caches installed gems automatically
bundler-cache: true

- name: Install Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
# Runs 'bundle install' and caches installed gems automatically
bundler-cache: true
- name: Install Minify
run: sudo apt-get update && sudo apt-get install minify

- name: Install Minify
run: sudo apt-get update && sudo apt-get install minify
# Build the website.

# Build the website.
- name: Build the static website
run: bundle exec jekyll build

- name: Build the static website
run: bundle exec jekyll build
# Upload resulting "_site" directory as artifact

# Upload resulting "_site" directory as artifact

- uses: actions/upload-artifact@v4
with:
name: site
path: _site/
- uses: actions/upload-artifact@v4
with:
name: site
path: _site/
20 changes: 20 additions & 0 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 🔗 GHA
on: [push, pull_request, merge_group]

concurrency:
group: ${{ github.workflow }}|${{ github.ref_name }}
cancel-in-progress: true

jobs:
# First stage: Only static checks, fast and prevent expensive builds from running.

static-checks:
if: "!vars.DISABLE_GODOT_CI"
name: 📊 Static checks
uses: ./.github/workflows/static_checks.yml

# Second stage: test build the PR
test-build:
name: 🌌 Test Build
needs: static-checks
uses: ./.github/workflows/build-pr.yml
31 changes: 31 additions & 0 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 📊 Static Checks
on:
workflow_call:

jobs:
static-checks:
name: Code style and file formatting
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get changed files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
files=$(git diff-tree --no-commit-id --name-only -r HEAD^1..HEAD 2> /dev/null || true)
elif [ "${{ github.event_name }}" == "push" -a "${{ github.event.forced }}" == "false" -a "${{ github.event.created }}" == "false" ]; then
files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.before }}..${{ github.event.after }} 2> /dev/null || true)
fi
echo "$files" >> changed.txt
cat changed.txt
files=$(echo "$files" | grep -v 'thirdparty' | xargs -I {} sh -c 'echo "\"./{}\""' | tr '\n' ' ')
echo "CHANGED_FILES=$files" >> $GITHUB_ENV

- name: pre-commit checks
uses: pre-commit/[email protected]
with:
extra_args: --files ${{ env.CHANGED_FILES }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ $RECYCLE.BIN/
*.msm
*.msp
*.lnk

# Python
.venv/
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
default_language_version:
python: python3

exclude: |
^(

)$

repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: [tomli]