-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.29 KB
/
static.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Static checks
# Based on https://github.com/Scony/godot-gdscript-toolkit/blob/master/action.yml
# In theory I could just copy this one:
# See https://github.com/lampe-games/godot-open-rts/blob/main/.github/workflows/main.yml
# But that pulls from the "released" version, not direct from git master,
# and currently I want the lateast as only it supports all Godot 4.2 GDscript features
# Also my command lines skips the addons folder which I don't want to format.
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
static-checks:
name: 'Static checks'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: create-requirements-if-not-exists
run: |
if [ ! -f requirements.txt ]; then
echo "gdtoolkit==4.*" > requirements.txt
fi
shell: bash
- id: install-python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"
- id: upgrade-setuptools
run: pip install --upgrade setuptools
shell: bash
- id: install-gdtoolkit
run: pip install "gdtoolkit==4.*"
shell: bash
- id: run-gdformat
run: find . -name '*.gd' -not -path "./addons/*" -print0 | xargs -0 gdformat --check
- id: run-gdlint
run: gdlint .