Skip to content

Commit 42247e9

Browse files
committed
Minimal + full CI
1 parent baaaa55 commit 42247e9

File tree

4 files changed

+127
-22
lines changed

4 files changed

+127
-22
lines changed

.github/composite/rust/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ runs:
3636
rustup default ${{ inputs.rust }}
3737
shell: bash
3838

39-
- uses: Swatinem/rust-cache@v2
39+
- name: "Reuse cached dependencies"
40+
uses: Swatinem/rust-cache@v2
4041
with:
4142
shared-key: ${{ inputs.cache-key }}
4243

.github/workflows/full-ci.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,8 @@
22
# License, v. 2.0. If a copy of the MPL was not distributed with this
33
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
44

5-
# Minimal CI workflow
6-
# Run when someone opens a PR and adds commits to the PR (this is recognized as a push to master)
7-
# Includes basic checks and unit/integration checks on Linux only
8-
9-
# Known issues:
10-
# 1. Error "Unable to process file command 'env' successfully." means there was an attempt to store multiline-content in a GitHub env var.
11-
# This should be done as in https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings:
12-
# echo 'VAR<<EOF' >> $GITHUB_ENV
13-
# curl https://example.lab >> $GITHUB_ENV
14-
# echo 'EOF' >> $GITHUB_ENV
15-
5+
# Full CI workflow
6+
# Run before merging. Rebases on master to make sure CI passes for latest integration, not only for the PR at the time of creation.
167

178
name: Full CI
189

@@ -48,6 +39,7 @@ jobs:
4839
- name: "Check rustfmt"
4940
run: cargo fmt --all -- --check
5041

42+
5143
unit-test:
5244
name: unit-test (${{ matrix.name }})
5345
runs-on: ${{ matrix.os }}
@@ -73,21 +65,30 @@ jobs:
7365
os: ubuntu-20.04
7466
rust-toolchain: stable
7567

68+
- name: linux-minimal-deps
69+
os: ubuntu-20.04
70+
rust-toolchain: stable
71+
rust-special: minimal-deps
72+
7673
steps:
7774
- uses: actions/checkout@v3
7875

7976
- name: "Install Rust"
8077
uses: ./.github/composite/rust
78+
with:
79+
rust: stable
80+
cache-key: ${{ matrix.rust-special }} # 'minimal-deps' or empty/not defined
8181

82-
- name: "Install minimal dependency versions from Cargo"
83-
run: cargo +nightly update -Z minimal-versions
84-
if: ${{ matrix.rust.special == 'minimal-deps' }}
85-
86-
- name: "Install Rust"
82+
- name: "Install Rust nightly (minimal deps)"
8783
uses: ./.github/composite/rust
8884
with:
89-
rust: stable
90-
cache-key: ${{ matrix.rust.special }} # 'minimal-deps' or empty/not defined
85+
rust: nightly
86+
cache-key: minimal-deps-nightly
87+
if: ${{ matrix.rust-special == 'minimal-deps' }}
88+
89+
- name: "Install minimal dependency versions from Cargo"
90+
run: cargo +nightly update -Z minimal-versions
91+
if: ${{ matrix.rust-special == 'minimal-deps' }}
9192

9293
- name: "Install LLVM"
9394
uses: ./.github/composite/llvm
@@ -139,12 +140,13 @@ jobs:
139140
binary-filename: ${{ matrix.godot-binary }}
140141
#godot_ver: ${{ matrix.godot }}
141142

143+
142144
license-guard:
143145
runs-on: ubuntu-20.04
144146
steps:
145147
- uses: actions/checkout@v3
146148

147-
- name: "Check and fix license headers"
149+
- name: "Check license headers"
148150
uses: apache/skywalking-eyes/[email protected]
149151
with:
150152
# log: debug # optional: set the log level. The default value is `info`.
@@ -154,6 +156,7 @@ jobs:
154156
# mode: # optional: Which mode License-Eye should be run in. Choices are `check` or `fix`. The default value is `check`.
155157
mode: check
156158

159+
157160
full-ci:
158161
if: github.event_name == 'push' && success()
159162
needs:

.github/workflows/minimal-ci.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
# Minimal CI workflow
6+
# Run when someone opens a PR and adds commits to the PR (this is recognized as a push to master)
7+
# Includes basic checks and unit/integration checks on Linux only
8+
9+
name: Minimal CI
10+
11+
on:
12+
pull_request:
13+
branches:
14+
- master
15+
16+
env:
17+
GDEXT_FEATURES: 'godot-core/convenience'
18+
GDEXT_CRATE_ARGS: '-p godot-codegen -p godot-ffi -p godot-core -p godot-macros -p godot'
19+
20+
defaults:
21+
run:
22+
shell: bash
23+
24+
# If a new commit is pushed before the old one's CI has completed (on the same branch), abort previous run
25+
#concurrency:
26+
# group: ${{ github.head_ref }}
27+
# cancel-in-progress: true
28+
29+
jobs:
30+
rustfmt:
31+
runs-on: ubuntu-20.04
32+
steps:
33+
- uses: actions/checkout@v3
34+
- name: "Install Rust"
35+
uses: ./.github/composite/rust
36+
with:
37+
rust: stable
38+
components: rustfmt
39+
- name: "Check rustfmt"
40+
run: cargo fmt --all -- --check
41+
42+
43+
unit-test:
44+
name: unit-test
45+
runs-on: ubuntu-20.04
46+
steps:
47+
- uses: actions/checkout@v3
48+
49+
- name: "Install Rust"
50+
uses: ./.github/composite/rust
51+
52+
- name: "Install LLVM"
53+
uses: ./.github/composite/llvm
54+
if: matrix.name == 'macos'
55+
56+
- name: "Compile tests"
57+
run: cargo test $GDEXT_CRATE_ARGS --features unit-test,$GDEXT_FEATURES --no-run
58+
59+
- name: "Test"
60+
run: cargo test $GDEXT_CRATE_ARGS --features unit-test,$GDEXT_FEATURES ${{ matrix.testflags }}
61+
62+
63+
itest-godot:
64+
name: itest-godot
65+
runs-on: ubuntu-20.04
66+
timeout-minutes: 24
67+
steps:
68+
- uses: actions/checkout@v3
69+
70+
- name: "Run Godot integration test"
71+
uses: ./.github/composite/godot
72+
with:
73+
artifact-name: godot-linux
74+
binary-filename: godot.linuxbsd.editor.dev.x86_64
75+
#godot_ver: ${{ matrix.godot }}
76+
77+
78+
license-guard:
79+
runs-on: ubuntu-20.04
80+
steps:
81+
- uses: actions/checkout@v3
82+
83+
- name: "Check and fix license headers"
84+
uses: apache/skywalking-eyes/[email protected]
85+
with:
86+
# log: debug # optional: set the log level. The default value is `info`.
87+
config: .github/external-config/licenserc.yml
88+
# token: # optional: the token that license eye uses when it needs to comment on the pull request.
89+
# Set to empty ("") to disable commenting on pull request. The default value is ${{ github.token }}
90+
# mode: # optional: Which mode License-Eye should be run in. Choices are `check` or `fix`. The default value is `check`.
91+
mode: fix
92+
93+
- name: "Commit changes"
94+
uses: EndBug/add-and-commit@v9
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
with:
98+
author_name: 'Godot-Rust Automation'
99+
author_email: '[email protected]'
100+
message: 'Auto-apply license headers'
101+

ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is an early-stage library to bind the **Rust** language to **Godot 4**.
77
[Godot] is an open-source game engine, whose upcoming version 4.0 brings several improvements.
88
Its _GDExtension_ API allows integrating third-party languages and libraries.
99

10-
> **Note**: if you are looking for a Rust binding for GDExtension (Godot 3), checkout [`gdnative`].
10+
> **Note**: if you are looking for a Rust binding for GDNative (Godot 3), checkout [`gdnative`].
1111
1212
> **Warning**: this library is experimental and rapidly evolving. In particular, this means:
1313
> * Lots of bugs. A lot of the scaffolding is still being ironed out.
@@ -46,7 +46,7 @@ To get the latest changes, you can regularly run a `cargo update` (possibly brea
4646

4747
To register the GDExtension library with Godot, you need to create two files relative to your Godot project folder:
4848

49-
1. First, add `res://MyExt.gdextension`, which is the equivalent of `.gdnlib` for GDExtension.
49+
1. First, add `res://MyExt.gdextension`, which is the equivalent of `.gdnlib` for GDNative.
5050

5151
The `[configuration]` section should be copied as-is.
5252
The `[libraries]` section should be updated to match the paths of your dynamic Rust libraries.

0 commit comments

Comments
 (0)