-
-
Notifications
You must be signed in to change notification settings - Fork 12
93 lines (86 loc) · 2.92 KB
/
zig.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Zig Test
on:
workflow_dispatch:
push:
paths:
- zig/**
env:
ZIG_VERSION: 0.13.0
ZIG_PATH: ~/sdk/zig
GODOT_VERSION: 4.3
GODOT_PATH: ~/sdk/godot
jobs:
godot_zig:
strategy:
matrix:
os: [ubuntu-latest] #, macos-latest, windows-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
lfs: true
# Cache Godot Imports
- name: Cache import assets
uses: actions/cache@v3
id: cache-import
with:
path: |
godot/.godot/imported/
key: import-assets-${{ runner.os }}-${{ github.sha }}
# Cache Zig
- name: Cache Zig
uses: actions/cache@v3
id: cache-zig
with:
path: |
${{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'
run: |
apt-get update
apt-get upgrade -y
apt-get install xz-utils -y
mkdir -p ~/sdk/zig
mkdir -p /home/downloads
wget https://ziglang.org/download/${{env.ZIG_VERSION}}/zig-linux-x86_64-${{env.ZIG_VERSION}}.tar.xz -O /home/downloads/zig-linux-x86_64-${{env.ZIG_VERSION}}.tar.xz
tar -xf /home/downloads/zig-linux-x86_64-${{env.ZIG_VERSION}}.tar.xz -C ~/sdk/zig
cp -r ~/sdk/zig/zig-linux-x86_64-${{env.ZIG_VERSION}}/* ~/sdk/zig
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
working-directory: ./zig
- name: Generate Zig Bindings
working-directory: ./zig
run: zig build bind
- name: Test
working-directory: ./zig
run: zig build test
- name: Lint
working-directory: ./zig
run: zig fmt --check ./src
- name: Build
working-directory: ./zig
run: zig build