Skip to content

Commit

Permalink
refactor: remove godot imports folder and add ci cache for it (#466)
Browse files Browse the repository at this point in the history
* remove .godot folder, add cache

* fix

* improve static checks

* no need to be per OS

* fix

* fix

* fix

* fix

* change import-assets to just warn

* fix cache order

* fix
  • Loading branch information
kuruk-mm authored Oct 24, 2024
1 parent cd90a4b commit 1c0271c
Show file tree
Hide file tree
Showing 441 changed files with 120 additions and 1,474 deletions.
24 changes: 24 additions & 0 deletions .github/actions/import-assets/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Import assets
description: Import assets

runs:
using: composite
steps:
# Step 1: Restore cache
- name: Restore Godot assets cache
uses: actions/cache@v3
with:
path: godot/.godot
key: ${{ runner.os }}-godot-assets-cache

# Step 2: Run the command that generates/uses the assets
- name: Import assets
shell: bash
run: cargo run -- import-assets

# Step 3: Save cache
- name: Cache Godot assets
uses: actions/cache@v3
with:
path: godot/.godot
key: ${{ runner.os }}-godot-assets-cache
2 changes: 1 addition & 1 deletion .github/actions/install-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ runs:
mkdir ffmpeg
mv ffmpeg-*/* ffmpeg/
Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n"
Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n"
Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n"
17 changes: 4 additions & 13 deletions .github/actions/set-up-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,8 @@ inputs:
runs:
using: composite
steps:
- name: Set up cargo cache
uses: actions/cache@v3
- uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
lib/target/
lib/Cargo.lock
target/
Cargo.lock
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
workspaces: |
.
lib/
9 changes: 9 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ jobs:
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.10/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Build
working-directory: lib
run: cargo build
- name: Copy library
run: cp lib/target/debug/libdclgodot.so godot/lib/

- name: Import Assets
uses: ./.github/actions/import-assets

- name: Run xtask coverage
run: |
export DISPLAY=:99
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ jobs:
- name: Install dependencies
uses: ./.github/actions/install-deps

# Build section
- name: Install
run: cargo run -- install


# Build section
- name: Build
working-directory: lib
run: cargo build --release
Expand All @@ -44,6 +45,9 @@ jobs:
- name: Copy library
run: cp lib/target/release/libdclgodot.so godot/lib/

- name: Import Assets
uses: ./.github/actions/import-assets

- name: Export
run: cargo run -- export

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- name: Install dependencies
uses: ./.github/actions/install-deps

# Build section
- name: Install
run: cargo run -- install

# Build section
- name: Build
working-directory: lib
run: cargo build --release
Expand All @@ -42,6 +42,9 @@ jobs:
- name: Copy library
run: cp lib/target/release/libdclgodot.dylib godot/lib/

- name: Import Assets
uses: ./.github/actions/import-assets

- name: Export
run: cargo run -- export

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,23 @@ jobs:
- run: rustup component add rustfmt
- name: Set up Python
uses: actions/setup-python@v4

- name: Install gdtoolkit 4
run: pip3 install git+https://github.com/kuruk-mm/godot-gdscript-toolkit.git

- name: Check format GDScript
run: gdformat -d godot/

- name: GDScript Linter
run: gdlint godot/

- name: Set up cache
uses: ./.github/actions/set-up-cache

- name: Install dependencies
uses: ./.github/actions/install-deps

- name: cargo xtask install
- name: cargo install
run: cargo run -- install --no-templates

- name: cargo check
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ jobs:
- name: Install dependencies
uses: ./.github/actions/install-deps

# Build section
- name: Install
run: cargo run -- install


# Build section
- name: Build
working-directory: lib
run: cargo build --release
Expand All @@ -47,6 +48,9 @@ jobs:
cp lib/target/release/dclgodot.dll godot/lib/
cp .bin/ffmpeg/ffmpeg-6.0-full_build-shared/bin/*.dll godot/lib/
- name: Import Assets
uses: ./.github/actions/import-assets

- name: Export
run: cargo run -- export

Expand Down
6 changes: 1 addition & 5 deletions godot/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Godot 4+ specific ignores
.godot/editor
.godot/export_credentials.cfg
.godot/shader_cache
.godot/exported
.godot/uid_cache.bin
/.godot/

android/

Expand Down
1 change: 0 additions & 1 deletion godot/.godot/.gdignore

This file was deleted.

Loading

0 comments on commit 1c0271c

Please sign in to comment.