Skip to content

Commit 4ebdc5e

Browse files
bors[bot]Bromeon
andauthored
Merge #96
96: No more unit-test special treatment, full clippy/test coverage, `check.sh` script, animation update r=Bromeon a=Bromeon See commit messages for details. Co-authored-by: Jan Haller <[email protected]>
2 parents 154b87f + 290afe3 commit 4ebdc5e

File tree

32 files changed

+407
-848
lines changed

32 files changed

+407
-848
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
name: godot
6+
description: "Run Godot integration tests"
7+
8+
inputs:
9+
artifact-name:
10+
required: true
11+
description: "Name of the compiled Godot artifact to download"
12+
13+
binary-filename:
14+
required: true
15+
description: "Filename of the Godot executable"
16+
17+
18+
runs:
19+
using: "composite"
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
# Replaces also backspaces on Windows, since they cause problems in Bash
24+
- name: "Store variable to Godot binary"
25+
run: |
26+
runnerDir=$(echo "${{ runner.temp }}" | sed "s!\\\\!/!")
27+
echo "RUNNER_DIR=$runnerDir" >> $GITHUB_ENV
28+
echo "GODOT4_BIN=$runnerDir/godot_bin/${{ inputs.binary-filename }}" >> $GITHUB_ENV
29+
shell: bash
30+
31+
# - name: "Check cache for installed Godot version"
32+
# id: "cache-godot"
33+
# uses: actions/cache@v3
34+
# with:
35+
# path: ${{ runner.temp }}/godot_bin
36+
# key: ${{ inputs.artifact-name }}-v${{ inputs.godot-ver }}
37+
# shell: bash
38+
39+
- name: "Download Godot artifact"
40+
# if: steps.cache-godot.outputs.cache-hit != 'true'
41+
run: |
42+
curl https://nightly.link/Bromeon/godot4-nightly/workflows/compile-godot/master/${{ inputs.artifact-name }}.zip \
43+
-Lo artifact.zip \
44+
--retry 3
45+
unzip artifact.zip -d $RUNNER_DIR/godot_bin
46+
shell: bash
47+
48+
- name: "Prepare Godot executable"
49+
run: |
50+
chmod +x $GODOT4_BIN
51+
shell: bash

.github/composite/godot/action.yml renamed to .github/composite/godot-itest/action.yml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,27 @@ inputs:
2424
default: ''
2525
description: "Extra command line arguments for 'cargo build', e.g. features"
2626

27+
with-llvm:
28+
required: false
29+
description: "Set to 'true' if LLVM should be installed"
30+
default: ''
31+
2732

2833
runs:
2934
using: "composite"
3035
steps:
3136
- uses: actions/checkout@v3
3237

33-
# Replaces also backspaces on Windows, since they cause problems in Bash
34-
- name: "Store variable to Godot binary"
35-
run: |
36-
runnerDir=$(echo "${{ runner.temp }}" | sed "s!\\\\!/!")
37-
echo "RUNNER_DIR=$runnerDir" >> $GITHUB_ENV
38-
echo "GODOT4_BIN=$runnerDir/godot_bin/${{ inputs.binary-filename }}" >> $GITHUB_ENV
39-
shell: bash
40-
41-
# - name: "Check cache for installed Godot version"
42-
# id: "cache-godot"
43-
# uses: actions/cache@v3
44-
# with:
45-
# path: ${{ runner.temp }}/godot_bin
46-
# key: ${{ inputs.artifact-name }}-v${{ inputs.godot-ver }}
47-
48-
- name: "Download Godot artifact"
49-
# if: steps.cache-godot.outputs.cache-hit != 'true'
50-
run: |
51-
curl https://nightly.link/Bromeon/godot4-nightly/workflows/compile-godot/master/${{ inputs.artifact-name }}.zip -Lo artifact.zip
52-
unzip artifact.zip -d $RUNNER_DIR/godot_bin
53-
shell: bash
38+
- name: "Install Godot"
39+
uses: ./.github/composite/godot-install
40+
with:
41+
artifact-name: ${{ inputs.artifact-name }}
42+
binary-filename: ${{ inputs.binary-filename }}
5443

5544
# The chmod seems still necessary, although applied before uploading artifact. Possibly modes are not preserved.
5645
# The `| xargs` pattern trims the output, since printed version may contain extra newline, which causes problems in env vars.
5746
- name: "Inspect Godot version"
5847
run: |
59-
chmod +x $GODOT4_BIN
6048
godotVer=$($GODOT4_BIN --version | xargs || true)
6149
gitSha=$(echo $godotVer | sed -E "s/.+custom_build\.//")
6250
echo "GODOT_BUILT_FROM=_Built from [\`$godotVer\`](https://github.com/godotengine/godot/commit/$gitSha)._" >> $GITHUB_ENV
@@ -89,10 +77,7 @@ runs:
8977
uses: ./.github/composite/rust
9078
with:
9179
rust: ${{ inputs.rust-toolchain }}
92-
93-
- name: "Install LLVM"
94-
uses: ./.github/composite/llvm
95-
# TODO only run it on systems needed
80+
with-llvm: ${{ inputs.with-llvm }}
9681

9782
- name: "Build godot-rust"
9883
run: |

.github/composite/rust/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,22 @@ inputs:
1010
required: false
1111
description: "Rust toolchain, e.g. 'stable' or 'nightly'"
1212
default: stable
13+
1314
components:
1415
required: false
1516
description: "Components array"
1617
default: ''
18+
1719
cache-key:
1820
required: false
1921
description: "Extra key to resolve cache"
2022
default: ''
2123

24+
with-llvm:
25+
required: false
26+
description: "Set to 'true' if LLVM should be installed"
27+
default: ''
28+
2229
runs:
2330
using: "composite"
2431
steps:
@@ -41,6 +48,10 @@ runs:
4148
with:
4249
shared-key: ${{ inputs.cache-key }}
4350

51+
- name: "Install LLVM"
52+
uses: ./.github/composite/llvm
53+
if: ${{ inputs.with-llvm == 'true' }}
54+
4455
- name: "Set environment variables used by toolchain"
4556
run: |
4657
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV

.github/external-config/licenserc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ header:
1111
paths:
1212
- '**/*.rs'
1313
- '**/*.gd'
14+
- '**/*.sh'
1415
- '.github/**/*.yml'
1516

1617
paths-ignore:
@@ -20,7 +21,7 @@ header:
2021

2122
language:
2223
GDScript:
23-
extensions: ['.gd']
24+
extensions: ['.gd', '.sh']
2425
comment_style_id: 'Hashtag'
2526
Rust:
2627
extensions: ['.rs']

.github/workflows/full-ci.yml

Lines changed: 31 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
env:
1717
GDEXT_FEATURES: 'godot-core/convenience'
18-
GDEXT_CRATE_ARGS: '-p godot-codegen -p godot-ffi -p godot-core -p godot-macros -p godot'
18+
# GDEXT_CRATE_ARGS: '-p godot-codegen -p godot-ffi -p godot-core -p godot-macros -p godot'
1919

2020
defaults:
2121
run:
@@ -52,35 +52,18 @@ jobs:
5252

5353
# TODO get rid of Godot binary, once the JSON is either versioned or fetched from somewhere
5454
# Replaces also backspaces on Windows, since they cause problems in Bash
55-
- name: "Store variable to Godot binary"
56-
run: |
57-
runnerDir=$(echo "${{ runner.temp }}" | sed "s!\\\\!/!")
58-
echo "RUNNER_DIR=$runnerDir" >> $GITHUB_ENV
59-
echo "GODOT4_BIN=$runnerDir/godot_bin/godot.linuxbsd.editor.dev.x86_64" >> $GITHUB_ENV
60-
61-
# - name: "Check cache for installed Godot version"
62-
# id: "cache-godot"
63-
# uses: actions/cache@v3
64-
# with:
65-
# path: ${{ runner.temp }}/godot_bin
66-
# key: ${{ inputs.artifact-name }}-v${{ inputs.godot-ver }}
67-
68-
- name: "Download Godot artifact"
69-
# if: steps.cache-godot.outputs.cache-hit != 'true'
70-
run: |
71-
curl https://nightly.link/Bromeon/godot4-nightly/workflows/compile-godot/master/godot-linux.zip -Lo artifact.zip
72-
unzip artifact.zip -d $RUNNER_DIR/godot_bin
73-
74-
- name: "Prepare Godot executable"
75-
run: |
76-
chmod +x $GODOT4_BIN
55+
- name: "Install Godot"
56+
uses: ./.github/composite/godot-install
57+
with:
58+
artifact-name: godot-linux
59+
binary-filename: godot.linuxbsd.editor.dev.x86_64
7760

7861
- name: "Check clippy"
79-
run: cargo clippy --features $GDEXT_FEATURES $GDEXT_CRATE_ARGS -- --cfg gdext_clippy -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented
62+
run: cargo clippy -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented
8063

8164

8265
unit-test:
83-
name: unit-test (${{ matrix.name }})
66+
name: unit-test (${{ matrix.name }}${{ matrix.rust-special }})
8467
runs-on: ${{ matrix.os }}
8568
continue-on-error: false
8669
strategy:
@@ -93,21 +76,25 @@ jobs:
9376
- name: macos
9477
os: macos-11
9578
rust-toolchain: stable
79+
godot-binary: godot.macos.editor.dev.x86_64
9680

9781
- name: windows
9882
os: windows-latest
9983
rust-toolchain: stable-x86_64-pc-windows-msvc
84+
godot-binary: godot.windows.editor.dev.x86_64.exe
10085

10186
# Don't use latest Ubuntu (22.04) as it breaks lots of ecosystem compatibility.
10287
# If ever moving to ubuntu-latest, need to manually install libtinfo5 for LLVM.
10388
- name: linux
10489
os: ubuntu-20.04
10590
rust-toolchain: stable
91+
godot-binary: godot.linuxbsd.editor.dev.x86_64
10692

107-
- name: linux-minimal-deps
93+
- name: linux
10894
os: ubuntu-20.04
10995
rust-toolchain: stable
110-
rust-special: minimal-deps
96+
rust-special: -minimal-deps
97+
godot-binary: godot.linuxbsd.editor.dev.x86_64
11198

11299
steps:
113100
- uses: actions/checkout@v3
@@ -117,35 +104,36 @@ jobs:
117104
with:
118105
rust: stable
119106
cache-key: ${{ matrix.rust-special }} # 'minimal-deps' or empty/not defined
107+
with-llvm: ${{ matrix.name == 'macos' }}
120108

121109
- name: "Install Rust nightly (minimal deps)"
122110
uses: ./.github/composite/rust
123111
with:
124112
rust: nightly
125113
cache-key: minimal-deps-nightly
126-
if: ${{ matrix.rust-special == 'minimal-deps' }}
114+
if: ${{ matrix.rust-special == '-minimal-deps' }}
127115

128116
- name: "Install minimal dependency versions from Cargo"
129117
run: cargo +nightly update -Z minimal-versions
130-
if: ${{ matrix.rust-special == 'minimal-deps' }}
118+
if: ${{ matrix.rust-special == '-minimal-deps' }}
131119

132-
- name: "Install LLVM"
133-
uses: ./.github/composite/llvm
134-
if: matrix.name == 'macos'
120+
# TODO get rid of Godot binary, once the JSON is either versioned or fetched from somewhere
121+
# Replaces also backspaces on Windows, since they cause problems in Bash
122+
- name: "Install Godot"
123+
uses: ./.github/composite/godot-install
124+
with:
125+
artifact-name: godot-${{ matrix.name }}
126+
binary-filename: ${{ matrix.godot-binary }}
135127

136128
- name: "Compile tests"
137-
run: cargo test $GDEXT_CRATE_ARGS --features $GDEXT_FEATURES --no-run
138-
env:
139-
RUSTFLAGS: --cfg=gdext_test
129+
run: cargo test --no-run
140130

141131
- name: "Test"
142-
run: cargo test $GDEXT_CRATE_ARGS --features $GDEXT_FEATURES
143-
env:
144-
RUSTFLAGS: --cfg=gdext_test
132+
run: cargo test $GDEXT_FEATURES
145133

146134

147-
itest-godot:
148-
name: itest-godot (${{ matrix.name }})
135+
godot-itest:
136+
name: godot-itest (${{ matrix.name }})
149137
runs-on: ${{ matrix.os }}
150138
continue-on-error: false
151139
timeout-minutes: 24
@@ -177,11 +165,11 @@ jobs:
177165
- uses: actions/checkout@v3
178166

179167
- name: "Run Godot integration test"
180-
uses: ./.github/composite/godot
168+
uses: ./.github/composite/godot-itest
181169
with:
182170
artifact-name: godot-${{ matrix.name }}
183171
binary-filename: ${{ matrix.godot-binary }}
184-
#godot_ver: ${{ matrix.godot }}
172+
with-llvm: ${{ matrix.name == 'macos' }}
185173

186174

187175
license-guard:
@@ -206,7 +194,7 @@ jobs:
206194
- rustfmt
207195
- clippy
208196
- unit-test
209-
- itest-godot
197+
- godot-itest
210198
- license-guard
211199
runs-on: ubuntu-20.04
212200
steps:

0 commit comments

Comments
 (0)