Skip to content

Commit b392652

Browse files
bors[bot]Bromeon
andauthored
Merge #50
50: Bors integration r=Bromeon a=Bromeon bors try Co-authored-by: Jan Haller <[email protected]>
2 parents ef1ccd7 + 42247e9 commit b392652

File tree

5 files changed

+188
-80
lines changed

5 files changed

+188
-80
lines changed

.github/bors.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
block_labels = ["status: duplicate", "status: wontfix"]
2+
delete_merged_branches = true
3+
status = ["full-ci"]

.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: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
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+
# 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.
7+
8+
name: Full CI
9+
10+
on:
11+
push:
12+
branches:
13+
- staging
14+
- trying
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 (${{ matrix.name }})
45+
runs-on: ${{ matrix.os }}
46+
continue-on-error: false
47+
strategy:
48+
fail-fast: false # cancel all jobs as soon as one fails?
49+
matrix:
50+
# Order this way because macOS typically has the longest duration, followed by Windows, so it benefits total workflow execution time.
51+
# Additionally, the 'linux (msrv *)' special case will then be listed next to the other 'linux' jobs.
52+
# Note: Windows uses '--target x86_64-pc-windows-msvc' by default as Cargo argument.
53+
include:
54+
- name: macos
55+
os: macos-11
56+
rust-toolchain: stable
57+
58+
- name: windows
59+
os: windows-latest
60+
rust-toolchain: stable-x86_64-pc-windows-msvc
61+
62+
# Don't use latest Ubuntu (22.04) as it breaks lots of ecosystem compatibility.
63+
# If ever moving to ubuntu-latest, need to manually install libtinfo5 for LLVM.
64+
- name: linux
65+
os: ubuntu-20.04
66+
rust-toolchain: stable
67+
68+
- name: linux-minimal-deps
69+
os: ubuntu-20.04
70+
rust-toolchain: stable
71+
rust-special: minimal-deps
72+
73+
steps:
74+
- uses: actions/checkout@v3
75+
76+
- name: "Install Rust"
77+
uses: ./.github/composite/rust
78+
with:
79+
rust: stable
80+
cache-key: ${{ matrix.rust-special }} # 'minimal-deps' or empty/not defined
81+
82+
- name: "Install Rust nightly (minimal deps)"
83+
uses: ./.github/composite/rust
84+
with:
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' }}
92+
93+
- name: "Install LLVM"
94+
uses: ./.github/composite/llvm
95+
if: matrix.name == 'macos'
96+
97+
- name: "Compile tests"
98+
run: cargo test $GDEXT_CRATE_ARGS --features unit-test,$GDEXT_FEATURES --no-run
99+
100+
- name: "Test"
101+
run: cargo test $GDEXT_CRATE_ARGS --features unit-test,$GDEXT_FEATURES ${{ matrix.testflags }}
102+
103+
104+
itest-godot:
105+
name: itest-godot (${{ matrix.name }})
106+
runs-on: ${{ matrix.os }}
107+
continue-on-error: false
108+
timeout-minutes: 24
109+
strategy:
110+
fail-fast: false # cancel all jobs as soon as one fails?
111+
matrix:
112+
# Order this way because macOS typically has the longest duration, followed by Windows, so it benefits total workflow execution time.
113+
# Additionally, the 'linux (msrv *)' special case will then be listed next to the other 'linux' jobs.
114+
# Note: Windows uses '--target x86_64-pc-windows-msvc' by default as Cargo argument.
115+
include:
116+
- name: macos
117+
os: macos-12
118+
rust-toolchain: stable
119+
godot-binary: godot.macos.editor.dev.x86_64
120+
121+
- name: windows
122+
os: windows-latest
123+
rust-toolchain: stable-x86_64-pc-windows-msvc
124+
godot-binary: godot.windows.editor.dev.x86_64.exe
125+
126+
# Don't use latest Ubuntu (22.04) as it breaks lots of ecosystem compatibility.
127+
# If ever moving to ubuntu-latest, need to manually install libtinfo5 for LLVM.
128+
- name: linux
129+
os: ubuntu-20.04
130+
rust-toolchain: stable
131+
godot-binary: godot.linuxbsd.editor.dev.x86_64
132+
133+
steps:
134+
- uses: actions/checkout@v3
135+
136+
- name: "Run Godot integration test"
137+
uses: ./.github/composite/godot
138+
with:
139+
artifact-name: godot-${{ matrix.name }}
140+
binary-filename: ${{ matrix.godot-binary }}
141+
#godot_ver: ${{ matrix.godot }}
142+
143+
144+
license-guard:
145+
runs-on: ubuntu-20.04
146+
steps:
147+
- uses: actions/checkout@v3
148+
149+
- name: "Check license headers"
150+
uses: apache/skywalking-eyes/[email protected]
151+
with:
152+
# log: debug # optional: set the log level. The default value is `info`.
153+
config: .github/external-config/licenserc.yml
154+
# token: # optional: the token that license eye uses when it needs to comment on the pull request.
155+
# Set to empty ("") to disable commenting on pull request. The default value is ${{ github.token }}
156+
# mode: # optional: Which mode License-Eye should be run in. Choices are `check` or `fix`. The default value is `check`.
157+
mode: check
158+
159+
160+
full-ci:
161+
if: github.event_name == 'push' && success()
162+
needs:
163+
- rustfmt
164+
- unit-test
165+
- itest-godot
166+
- license-guard
167+
runs-on: ubuntu-20.04
168+
steps:
169+
- name: "Mark the job as a success"
170+
run: exit 0

.github/workflows/minimal-ci.yml

Lines changed: 11 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,12 @@
66
# Run when someone opens a PR and adds commits to the PR (this is recognized as a push to master)
77
# Includes basic checks and unit/integration checks on Linux only
88

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-
16-
179
name: Minimal CI
1810

1911
on:
20-
push:
12+
pull_request:
2113
branches:
2214
- master
23-
pull_request:
24-
# branches:
25-
# - master
2615

2716
env:
2817
GDEXT_FEATURES: 'godot-core/convenience'
@@ -50,47 +39,16 @@ jobs:
5039
- name: "Check rustfmt"
5140
run: cargo fmt --all -- --check
5241

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
7742

43+
unit-test:
44+
name: unit-test
45+
runs-on: ubuntu-20.04
7846
steps:
7947
- uses: actions/checkout@v3
8048

8149
- name: "Install Rust"
8250
uses: ./.github/composite/rust
8351

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-
9452
- name: "Install LLVM"
9553
uses: ./.github/composite/llvm
9654
if: matrix.name == 'macos'
@@ -102,48 +60,23 @@ jobs:
10260
run: cargo test $GDEXT_CRATE_ARGS --features unit-test,$GDEXT_FEATURES ${{ matrix.testflags }}
10361

10462

105-
integration-test-godot:
106-
name: itest-godot (${{ matrix.name }})
107-
runs-on: ${{ matrix.os }}
108-
continue-on-error: false
63+
itest-godot:
64+
name: itest-godot
65+
runs-on: ubuntu-20.04
10966
timeout-minutes: 24
110-
strategy:
111-
fail-fast: false # cancel all jobs as soon as one fails?
112-
matrix:
113-
# Order this way because macOS typically has the longest duration, followed by Windows, so it benefits total workflow execution time.
114-
# Additionally, the 'linux (msrv *)' special case will then be listed next to the other 'linux' jobs.
115-
# Note: Windows uses '--target x86_64-pc-windows-msvc' by default as Cargo argument.
116-
include:
117-
- name: macos
118-
os: macos-12
119-
rust-toolchain: stable
120-
godot-binary: godot.macos.editor.dev.x86_64
121-
122-
- name: windows
123-
os: windows-latest
124-
rust-toolchain: stable-x86_64-pc-windows-msvc
125-
godot-binary: godot.windows.editor.dev.x86_64.exe
126-
127-
# Don't use latest Ubuntu (22.04) as it breaks lots of ecosystem compatibility.
128-
# If ever moving to ubuntu-latest, need to manually install libtinfo5 for LLVM.
129-
- name: linux
130-
os: ubuntu-20.04
131-
rust-toolchain: stable
132-
godot-binary: godot.linuxbsd.editor.dev.x86_64
133-
13467
steps:
13568
- uses: actions/checkout@v3
13669

13770
- name: "Run Godot integration test"
13871
uses: ./.github/composite/godot
13972
with:
140-
artifact-name: godot-${{ matrix.name }}
141-
binary-filename: ${{ matrix.godot-binary }}
73+
artifact-name: godot-linux
74+
binary-filename: godot.linuxbsd.editor.dev.x86_64
14275
#godot_ver: ${{ matrix.godot }}
14376

77+
14478
license-guard:
14579
runs-on: ubuntu-20.04
146-
if: github.ref != 'refs/heads/master'
14780
steps:
14881
- uses: actions/checkout@v3
14982

@@ -165,3 +98,4 @@ jobs:
16598
author_name: 'Godot-Rust Automation'
16699
author_email: '[email protected]'
167100
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)