Skip to content

Commit

Permalink
Turn Based Combat (#6)
Browse files Browse the repository at this point in the history
* feat: turn-based-combat setup

* Added github lint checks (#5)

* feat: ci checks

* fix: cspell version number

* fix: cspell config path

* fix: grammar

* chore: fix linting warning

* fix: linting

* fix: formatting errors

* fix: discord notifications

* fix: update poetry

* chore: cleanup unit script
  • Loading branch information
snorreks authored Jan 16, 2025
1 parent 4cf956b commit 24e56c5
Show file tree
Hide file tree
Showing 147 changed files with 2,736 additions and 2,126 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/discord-notifications-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pull Request Notifications

on:
pull_request:
types: [opened, reopened]

jobs:
notify-on-pr:
name: Notify Discord on Pull Request
runs-on: ubuntu-latest
steps:
- name: Notify Discord about New PR
uses: tsickert/discord-webhook@v6.0.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: '🔔 New Pull Request Created!'
embed-description: |
**Title:** ${{ github.event.pull_request.title }}
**Description:** ${{ github.event.pull_request.body }}
**Branch:** ${{ github.event.pull_request.head.ref }}
**Created by:** ${{ github.actor }}
[View Pull Request](${{ github.event.pull_request.html_url }})
embed-color: 3447003 # Dark blue
42 changes: 42 additions & 0 deletions .github/workflows/discord-notifications-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check Build, Release and Deploy Status

on:
workflow_run:
workflows: ['Build, Release and Deploy'] # Triggered by this workflow
types:
- completed # Trigger when the workflow completes

jobs:
notify-status:
name: Notify Discord on Workflow Status
runs-on: ubuntu-latest

steps:
# Notify on Success
- name: Notify Discord on Success
if: ${{ github.event.workflow_run.conclusion == 'success' }} # Runs only on success
uses: tsickert/discord-webhook@v6.0.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: '🎉 Build, Release, and Deploy Succeeded!'
embed-description: |
**Version:** ${{ github.event.workflow_run.head_branch }}
**Repository:** ${{ github.repository }}
**Triggered by:** ${{ github.event.workflow_run.actor }}
embed-color: 65280 # Green
embed-footer-text: 'The pipeline completed successfully!'

# Notify on Failure
- name: Notify Discord on Failure
if: ${{ github.event.workflow_run.conclusion == 'failure' }} # Runs only on failure
uses: tsickert/discord-webhook@v6.0.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: '🚨 Build, Release, and Deploy Failed!'
embed-description: |
**Workflow:** Build, Release, and Deploy
**Repository:** ${{ github.repository }}
**Branch:** ${{ github.event.workflow_run.head_branch }}
**Triggered by:** ${{ github.event.workflow_run.actor }}
embed-color: 15158332 # Red
embed-footer-text: 'The pipeline encountered errors.'
25 changes: 25 additions & 0 deletions .github/workflows/discord-notifications-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Discord Push Notifications

on:
push:
branches:
- '**' # Notify for all branches
paths:
- '**' # Notify only when files are changed

jobs:
notify-on-push:
name: Notify on Push
runs-on: ubuntu-latest
steps:
- name: Notify Discord about Push
uses: tsickert/discord-webhook@v6.0.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: '🚀 New Commit Pushed!'
embed-description: |
**Commit Message:** ${{ github.event.head_commit.message }}
**Branch:** ${{ github.ref_name }}
**Author:** ${{ github.actor }}
[View Commit](${{ github.event.head_commit.url }})
embed-color: 3066993 # Blue
34 changes: 34 additions & 0 deletions .github/workflows/generic-pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Runs on non-game files for:
# - Push to master/main
# - Pull requests to master/main/dev
name: Generic CI

on:
push:
branches: ['master', 'main']
paths:
- '**'
- '!game/**' # Excludes game directory
pull_request:
branches: ['master', 'main', 'dev']
paths:
- '**'
- '!game/**' # Excludes game directory

jobs:
spellcheck:
name: 'Spellcheck'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

# Runs spellcheck using cspell
# Requires cspell.json in root directory
- name: Check spelling
uses: streetsidesoftware/cspell-action@v6
with:
# See https://github.com/streetsidesoftware/cspell-action?tab=readme-ov-file#usage
config: '.vscode/cspell.json'
incremental_files_only: false # Check all files, not just changed ones
root: '.'
122 changes: 122 additions & 0 deletions .github/workflows/godot-pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Runs on game directory files for:
# - Push to master/main
# - Pull requests to master/main/dev
name: Godot CI

on:
push:
branches: ['master', 'main']
paths:
- 'game/**' # Only runs when game files change
pull_request:
branches: ['master', 'main', 'dev']
paths:
- 'game/**' # Only runs when game files change

jobs:
spell-check:
name: 'Spellcheck'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/cspell-action@v6
with:
config: '.vscode/cspell.json'
incremental_files_only: false
root: './game'

# Formatting check
format-check:
name: 'GDScript Formatting Check'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

# Install GDScript toolkit for formatting
- name: Setup GDScript toolkit
uses: Scony/godot-gdscript-toolkit@4.2.0

# Run formatting check
- name: Check formatting
run: |
cd game
gdformat --check ./
# Linting check
lint-check:
name: 'GDScript Linting Check'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

# Install GDScript toolkit for linting
- name: Setup GDScript toolkit
uses: Scony/godot-gdscript-toolkit@4.2.0

# Run linting check
- name: Run linting
run: |
cd game
gdlint ./
# Runs visual tests with specific graphics drivers
visual-tests:
name: 'Visual Tests (${{ matrix.render-driver }})'
runs-on: ubuntu-latest
# Prevents duplicate workflows on PRs from same repository
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
strategy:
fail-fast: false
matrix:
render-driver: [vulkan] # Can add opengl3 if needed
steps:
# Checkout with LFS and submodules
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
submodules: 'recursive'

# Setup .NET environment
- name: Setup .NET
uses: actions/setup-dotnet@v4.0.0
with:
global-json-file: global.json

- name: Restore dependencies
run: dotnet restore

# Setup graphics drivers
- name: Add graphics repositories
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo add-apt-repository -n ppa:kisak/kisak-mesa
# Install and cache graphics packages
- name: Install graphics drivers
uses: awalsh128/cache-apt-pkgs-action@v1.4.1
with:
packages: mesa-vulkan-drivers binutils
version: 1.0

# Setup Godot environment
- name: Setup Godot
uses: chickensoft-games/setup-godot@v2.0.0
with:
version: global.json

# Generate C# bindings
- name: Generate .NET Bindings
working-directory: ./game
run: godot --headless --build-solutions --quit || exit 0

# Run the actual tests
- name: Run Tests
working-directory: ./game
run: |
xvfb-run godot --audio-driver Dummy --rendering-driver ${{ matrix.render-driver }} --run-tests --quit-on-finish --coverage
104 changes: 104 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"dictionaries": ["softwareTerms"],
"ignorePaths": [
"**/*.tscn",
"**/*.import",
"**/*.godot/**/*.*",
"**/*.tres",
"**/*.svg",
"**/*.tmp",
"**/*project.godot",
"**/*node_modules",
"**/*dist",
"**/*export_presets.cfg"
],
"words": [
"clampi",
"elif",
"NPCS",
"onready",
"randf",
"roundi",
"tilemap",
"tscn",
"unfocus",
"webp",
"wrapi",
"printerr",
"huggingface",
"nerijs",
"stabilityai",
"lefthook",
"gdtoolkit",
"gdlintrc",
"gameplay",
"gdlint",
"gdformat",
"tilesets",
"webgl",
"dalle",
"elevenlabs",
"ollama",
"sfxs",
"vsync",
"borderless",
"unparent",
"equipable",
"chestplate",

"predelete",
"stylebox",
"hbox",
"unequip",
"pixelmix",
"astar",
"darkmode",
"setuptools",
"embedder",
"startfile",
// Godot terms
"gdscript",
"orangered",
"clampf",
"aabb",
"deadzone",
"lerp",
"snappedf",

// Maybe rename
"iconify",
"daynightcycle",
"pathfinding",
"rects",
"autosplit",
"unstreched",
"autosplitmerge",
"protoset",
"weakref",
"knockback",
"unstringify",
"unparented",
"pushable",
"prewritten",

// in-game terms
"bearly",
"aikami",
"halfling",
"dragonborn",
"tiefling",
"baldur",
"debuffs",
"cooldown",
"cooldowns",

// names
"Sauron",
"Aragorn",
"Rohan",
"Gondor",
"Arwen"
]
}
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/linting.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Common linting problems

- If gdlint/gdformat crashes
- If gdlint/gdformat crashes

`AttributeError: 'PatternStr' object has no attribute 'raw'`

Expand All @@ -11,7 +11,7 @@ It might be because you are using lambda function directly like this:
```python

test.connect(func()->void:
if statment:
if statement:
return x
)

Expand Down
Loading

0 comments on commit 24e56c5

Please sign in to comment.