Skip to content

Commit 5513c00

Browse files
authored
Merge pull request #48 from godot-rust/qol/ci-and-codegen
CI + codegen improvements; header update
2 parents 862bc55 + 7488b2e commit 5513c00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1194
-1050
lines changed

.github/composite/godot/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ runs:
9292

9393
- name: "Install LLVM"
9494
uses: ./.github/composite/llvm
95+
# TODO only run it on systems needed
9596

9697
- name: "Build godot-rust"
9798
run: |

.github/workflows/minimal-ci.yml

+71-35
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on:
2626

2727
env:
2828
GDEXT_FEATURES: 'godot-core/convenience'
29+
GDEXT_CRATE_ARGS: '-p godot-codegen -p godot-ffi -p godot-core -p godot-macros -p godot'
2930

3031
defaults:
3132
run:
@@ -37,51 +38,86 @@ defaults:
3738
# cancel-in-progress: true
3839

3940
jobs:
40-
# rustfmt:
41-
# runs-on: ubuntu-latest
42-
# steps:
43-
# - uses: actions/checkout@v3
44-
# - name: "Install Rust"
45-
# uses: ./.github/composite/rust
46-
# with:
47-
# rust: stable
48-
# components: rustfmt
49-
# - name: "Check rustfmt"
50-
# run: cargo fmt --all -- --check
51-
52-
# unit-test:
53-
# runs-on: ubuntu-latest
54-
# steps:
55-
# - uses: actions/checkout@v3
56-
# - name: "Install Rust"
57-
# uses: ./.github/composite/rust
58-
#
59-
# # TODO seems unneeded in GDNative...?
60-
# - name: "Install LLVM"
61-
# uses: ./.github/composite/llvm
62-
#
63-
# - name: "Compile tests"
64-
# run: cargo test --workspace --features ${GDEXT_FEATURES} --no-run
65-
#
66-
# - name: "Test"
67-
# run: cargo test --workspace --features ${GDEXT_FEATURES}
41+
rustfmt:
42+
runs-on: ubuntu-20.04
43+
steps:
44+
- uses: actions/checkout@v3
45+
- name: "Install Rust"
46+
uses: ./.github/composite/rust
47+
with:
48+
rust: stable
49+
components: rustfmt
50+
- name: "Check rustfmt"
51+
run: cargo fmt --all -- --check
52+
53+
unit-test:
54+
name: test (${{ matrix.name }})
55+
runs-on: ${{ matrix.os }}
56+
continue-on-error: false
57+
strategy:
58+
fail-fast: false # cancel all jobs as soon as one fails?
59+
matrix:
60+
# Order this way because macOS typically has the longest duration, followed by Windows, so it benefits total workflow execution time.
61+
# Additionally, the 'linux (msrv *)' special case will then be listed next to the other 'linux' jobs.
62+
# Note: Windows uses '--target x86_64-pc-windows-msvc' by default as Cargo argument.
63+
include:
64+
- name: macos
65+
os: macos-11
66+
rust-toolchain: stable
67+
68+
- name: windows
69+
os: windows-latest
70+
rust-toolchain: stable-x86_64-pc-windows-msvc
71+
72+
# Don't use latest Ubuntu (22.04) as it breaks lots of ecosystem compatibility.
73+
# If ever moving to ubuntu-latest, need to manually install libtinfo5 for LLVM.
74+
- name: linux
75+
os: ubuntu-20.04
76+
rust-toolchain: stable
77+
78+
steps:
79+
- uses: actions/checkout@v3
80+
81+
- name: "Install Rust"
82+
uses: ./.github/composite/rust
83+
84+
- name: "Install minimal dependency versions from Cargo"
85+
run: cargo +nightly update -Z minimal-versions
86+
if: ${{ matrix.rust.special == 'minimal-deps' }}
87+
88+
- name: "Install Rust"
89+
uses: ./.github/composite/rust
90+
with:
91+
rust: stable
92+
cache-key: ${{ matrix.rust.special }} # 'minimal-deps' or empty/not defined
93+
94+
- name: "Install LLVM"
95+
uses: ./.github/composite/llvm
96+
if: matrix.name == 'macos'
97+
98+
- name: "Compile tests"
99+
run: cargo test $GDEXT_CRATE_ARGS --features unit-test,$GDEXT_FEATURES --no-run
100+
101+
- name: "Test"
102+
run: cargo test $GDEXT_CRATE_ARGS --features unit-test,$GDEXT_FEATURES ${{ matrix.testflags }}
103+
68104

69105
integration-test-godot:
70-
name: itest-godot-${{ matrix.name }}
71-
timeout-minutes: 15
106+
name: itest-godot (${{ matrix.name }})
72107
runs-on: ${{ matrix.os }}
73108
continue-on-error: false
109+
timeout-minutes: 24
74110
strategy:
75111
fail-fast: false # cancel all jobs as soon as one fails?
76112
matrix:
77113
# Order this way because macOS typically has the longest duration, followed by Windows, so it benefits total workflow execution time.
78114
# Additionally, the 'linux (msrv *)' special case will then be listed next to the other 'linux' jobs.
79115
# Note: Windows uses '--target x86_64-pc-windows-msvc' by default as Cargo argument.
80116
include:
81-
# - name: macos
82-
# os: macos-12
83-
# rust-toolchain: stable
84-
# godot-binary: godot.macos.editor.dev.x86_64
117+
- name: macos
118+
os: macos-12
119+
rust-toolchain: stable
120+
godot-binary: godot.macos.editor.dev.x86_64
85121

86122
- name: windows
87123
os: windows-latest
@@ -106,7 +142,7 @@ jobs:
106142
#godot_ver: ${{ matrix.godot }}
107143

108144
license-guard:
109-
runs-on: ubuntu-latest
145+
runs-on: ubuntu-20.04
110146
if: github.ref != 'refs/heads/master'
111147
steps:
112148
- uses: actions/checkout@v3

examples/dodge-the-creeps/godot/Main.tscn

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
[ext_resource type="PackedScene" uid="uid://4vwrqjegqwpj" path="res://Player.tscn" id="3"]
44
[ext_resource type="PackedScene" uid="uid://b6f427lco0mqk" path="res://Hud.tscn" id="4"]
5-
[ext_resource type="AudioStream" uid="uid://q2pf4fr8d0ks" path="res://art/House In a Forest Loop.ogg" id="5"]
6-
[ext_resource type="AudioStream" uid="uid://dw26fpygeag8o" path="res://art/gameover.wav" id="6"]
5+
[ext_resource type="AudioStream" uid="uid://jy3fk3ujnkpl" path="res://art/House In a Forest Loop.ogg" id="5"]
6+
[ext_resource type="AudioStream" uid="uid://cfb6f1t1p6axm" path="res://art/gameover.wav" id="6"]
77

88
[sub_resource type="Curve2D" id="1"]
99
_data = {
@@ -52,4 +52,4 @@ stream = ExtResource("6")
5252
[connection signal="timeout" from="MobTimer" to="." method="on_mob_timer_timeout"]
5353
[connection signal="timeout" from="ScoreTimer" to="." method="on_score_timer_timeout"]
5454
[connection signal="timeout" from="StartTimer" to="." method="on_start_timer_timeout"]
55-
[connection signal="start_game" from="Hud" to="." method="new_game" flags=3]
55+
[connection signal="start_game" from="Hud" to="." method="new_game" flags=3]

examples/dodge-the-creeps/godot/Mob.tscn

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[gd_scene load_steps=9 format=3 uid="uid://rkdnhqgf2hpj"]
22

3-
[ext_resource type="Texture2D" uid="uid://yqglrrsx7j1f" path="res://art/enemyFlyingAlt_1.png" id="2"]
4-
[ext_resource type="Texture2D" uid="uid://bpot8awhdn6ph" path="res://art/enemyFlyingAlt_2.png" id="3"]
5-
[ext_resource type="Texture2D" uid="uid://bu4221t7qpa7d" path="res://art/enemyWalking_1.png" id="4"]
6-
[ext_resource type="Texture2D" uid="uid://booij5t7h4efb" path="res://art/enemyWalking_2.png" id="5"]
7-
[ext_resource type="Texture2D" uid="uid://5lvm88ij4jqn" path="res://art/enemySwimming_1.png" id="6"]
8-
[ext_resource type="Texture2D" uid="uid://bng45cvsgufqc" path="res://art/enemySwimming_2.png" id="7"]
3+
[ext_resource type="Texture2D" uid="uid://ch2bfqohapw00" path="res://art/enemyFlyingAlt_1.png" id="2"]
4+
[ext_resource type="Texture2D" uid="uid://uhy7j2necuj2" path="res://art/enemyFlyingAlt_2.png" id="3"]
5+
[ext_resource type="Texture2D" uid="uid://dd56ab6ouwms7" path="res://art/enemyWalking_1.png" id="4"]
6+
[ext_resource type="Texture2D" uid="uid://dulw5juue3ivn" path="res://art/enemyWalking_2.png" id="5"]
7+
[ext_resource type="Texture2D" uid="uid://cnwoep5enlhrj" path="res://art/enemySwimming_1.png" id="6"]
8+
[ext_resource type="Texture2D" uid="uid://eqshh2v5g0dn" path="res://art/enemySwimming_2.png" id="7"]
99

1010
[sub_resource type="SpriteFrames" id="1"]
1111
animations = [{
@@ -37,6 +37,7 @@ gravity_scale = 0.0
3737
scale = Vector2(0.75, 0.75)
3838
frames = SubResource("1")
3939
animation = &"walk"
40+
playing = true
4041

4142
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
4243
rotation = 1.5708

examples/dodge-the-creeps/godot/Player.tscn

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[gd_scene load_steps=12 format=3 uid="uid://4vwrqjegqwpj"]
22

3-
[ext_resource type="Texture2D" uid="uid://ftkxr8r4qghp" path="res://art/playerGrey_walk1.png" id="2"]
4-
[ext_resource type="Texture2D" uid="uid://couyhcegeihme" path="res://art/playerGrey_walk2.png" id="3"]
5-
[ext_resource type="Texture2D" uid="uid://b4yyoafu8bi0q" path="res://art/playerGrey_up1.png" id="4"]
6-
[ext_resource type="Texture2D" uid="uid://bko65a0nd66st" path="res://art/playerGrey_up2.png" id="5"]
3+
[ext_resource type="Texture2D" uid="uid://bei50n77gmlml" path="res://art/playerGrey_walk1.png" id="2"]
4+
[ext_resource type="Texture2D" uid="uid://bdkoaa5a3c44c" path="res://art/playerGrey_walk2.png" id="3"]
5+
[ext_resource type="Texture2D" uid="uid://qpg7fsh1wnd6" path="res://art/playerGrey_up1.png" id="4"]
6+
[ext_resource type="Texture2D" uid="uid://c4vx8t665is8j" path="res://art/playerGrey_up2.png" id="5"]
77

88
[sub_resource type="SpriteFrames" id="1"]
99
animations = [{
@@ -41,6 +41,7 @@ scale_curve = SubResource("6")
4141
color_ramp = SubResource("4")
4242

4343
[node name="Player" type="Player"]
44+
visible = false
4445
z_index = 10
4546

4647
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]

0 commit comments

Comments
 (0)