Skip to content

Commit

Permalink
Update the Github Workfllow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Makosai committed Aug 19, 2024
1 parent fa273f2 commit e7cfbeb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/zig.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Zig Test

on:
on:
workflow_dispatch:
push:
paths:
Expand All @@ -9,11 +9,11 @@ on:
env:
ZIG_VERSION: 0.13.0
ZIG_PATH: ~/sdk/zig
GODOT_VERSION: 4.3
GODOT_PATH: ~/sdk/godot

jobs:
godot_zig:
container:
image: barichello/godot-ci:4.3
strategy:
matrix:
os: [ubuntu-latest] #, macos-latest, windows-latest]
Expand All @@ -32,7 +32,7 @@ jobs:
path: |
godot/.godot/imported/
key: import-assets-${{ runner.os }}-${{ github.sha }}

# Cache Zig
- name: Cache Zig
uses: actions/cache@v3
Expand All @@ -42,6 +42,14 @@ jobs:
${{env.ZIG_PATH}}
key: zig-${{ runner.os }}-${{ github.sha }}

# Cache Godot
- name: Cache Godot
uses: actions/cache@v3
id: cache-godot
with:
path: |
${{env.GODOT_PATH}}
key: godot-${{ runner.os }}-${{ github.sha }}

- name: Install Zig
if: steps.cache-zig.outputs.cache-hit != 'true'
Expand All @@ -57,6 +65,16 @@ jobs:
rm -rf ~/sdk/zig/zig-linux-x86_64-${{env.ZIG_VERSION}}
- name: Add Zig to PATH
run: echo ${{env.ZIG_PATH}} >> $GITHUB_PATH
- name: Install Godot
if: steps.cache-godot.outputs.cache-hit != 'true'
run: |
mkdir -p ~/sdk/godot
mkdir -p /home/downloads
wget https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_linux.x86_64.zip -O /home/downloads/Godot_v4.3-stable_linux.x86_64.zip
unzip /home/downloads/Godot_v4.3-stable_linux.x86_64.zip -d ~/sdk/godot
mv ~/sdk/godot/Godot_v4.3-stable_linux.x86_64 ~/sdk/godot/godot
- name: Add Godot to PATH
run: echo ${{env.GODOT_PATH}} >> $GITHUB_PATH
- name: Generate Godot Project
if: steps.cache-import.outputs.cache-hit != 'true'
run: godot --headless --verbose --editor --quit --rendering-driver opengl3 -e ../godot
Expand All @@ -69,7 +87,7 @@ jobs:
run: zig build test
- name: Lint
working-directory: ./zig
run: zig fmt --check .
run: zig fmt --check ./src
- name: Build
working-directory: ./zig
run: zig build
2 changes: 0 additions & 2 deletions zig/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ const Godot = @import("godot");
const builtin = @import("builtin");
const GPA = std.heap.GeneralPurposeAllocator(.{});

// 3

var gpa = GPA{};

pub export fn my_extension_init(p_get_proc_address: Godot.GDExtensionInterfaceGetProcAddress, p_library: Godot.GDExtensionClassLibraryPtr, r_initialization: [*c]Godot.GDExtensionInitialization) Godot.GDExtensionBool {
Expand Down

0 comments on commit e7cfbeb

Please sign in to comment.