Skip to content

Commit

Permalink
Setup tests
Browse files Browse the repository at this point in the history
- Install Gut using gd-plug.
- Add some basic tests.
- Update workflow to run tests.
- Add test and gd-plug install/uninstall recipes to Justfile.
- Re-enable debug builds as these are used by editor when testing.
  • Loading branch information
lihop committed Feb 17, 2024
1 parent 1c555f0 commit d318a25
Show file tree
Hide file tree
Showing 128 changed files with 1,410 additions and 16,444 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*.wav binary

# Files to exclude from asset-lib download.
/addons/gut export-ignore
/addons/gd-plug export-ignore
/CHANGELOG.md export-ignore
/default_env.tres export-ignore
/docs export-ignore
Expand All @@ -32,6 +32,8 @@
/Justfile export-ignore
/LICENSE.md export-ignore
/misc export-ignore
/plug.gd export-ignore
/.plugged export-ignore
/.pre-commit-config.yaml export-ignore
/project.godot export-ignore
/README.md export-ignore
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/import-assets/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ runs:
uses: lihop/setup-godot@v2
with:
version: ${{ inputs.godot-version }}
- name: Install just
uses: taiki-e/install-action@just
- name: Install dev dependencies
run: just install
- name: Import assets
shell: bash
run: |
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
fail-fast: false
matrix:
arch: [x86_64, x86_32]
target: [release]
target: [release, debug]
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
fail-fast: false
matrix:
platform: [web, macos, windows]
target: [release]
target: [release, debug]
bits: [64, 32]
exclude:
- platform: web
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
path: docs/demo

test:
name: Test (${{ matrix.platform }}, ${{ matrix.arch }}, release)
name: Test (${{ matrix.platform }}, ${{ matrix.arch }}, debug)
needs: [check-archive, check-pre-commit]
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -284,6 +284,8 @@ jobs:
uses: lihop/setup-godot@v2
with:
version: "4.2.1-stable"
- uses: taiki-e/install-action@just
- run: just install
- name: Wait for asset import
uses: fountainhead/[email protected]
with:
Expand All @@ -299,13 +301,15 @@ jobs:
uses: fountainhead/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: Build (${{ matrix.platform }}, ${{ matrix.arch }}, release)
checkName: Build (${{ matrix.platform }}, ${{ matrix.arch }}, debug)
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Install binary build artifacts
uses: actions/download-artifact@v3
with:
name: libgodot-xterm-release
name: libgodot-xterm-debug
path: addons/godot_xterm/native/bin
- name: Test
run: just test

delete-asset-imports:
name: Delete Asset Imports
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ test/test_metadata.json

# GodotXterm-specific ignores
.gdxterm
.plugged/
addons/*
!addons/gd-plug/
!addons/godot_xterm/
docs/demo
docs/logs

Expand Down
Empty file added .plugged/.gdignore
Empty file.
9 changes: 9 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@ godot := `echo "${GODOT:-godot}"`

build:
cd addons/godot_xterm/native && scons

install:
{{godot}} --headless -s plug.gd install

test:
{{godot}} --headless -s addons/gut/gut_cmdln.gd

uninstall:
{{godot}} --headless -s plug.gd uninstall
Loading

0 comments on commit d318a25

Please sign in to comment.