diff --git a/.github/workflows/zig.yml b/.github/workflows/zig.yml index c7fd79a4..97167dbc 100644 --- a/.github/workflows/zig.yml +++ b/.github/workflows/zig.yml @@ -1,6 +1,6 @@ name: Zig Test -on: +on: workflow_dispatch: push: paths: @@ -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] @@ -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 @@ -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' @@ -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 @@ -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 diff --git a/zig/src/main.zig b/zig/src/main.zig index 8998d8df..e3a8fac4 100644 --- a/zig/src/main.zig +++ b/zig/src/main.zig @@ -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 {