-
-
Notifications
You must be signed in to change notification settings - Fork 301
173 lines (152 loc) · 8.15 KB
/
Copy pathfull-ci.yml
File metadata and controls
173 lines (152 loc) · 8.15 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# Copyright (c) godot-rust; Bromeon and contributors.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
name: Full CI
#
# Runs before merging. Rebases on master to make sure CI passes for latest integration, not only for the PR at the time of creation.
on:
# Allow manually triggering the workflow:
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:
merge_group:
push:
env:
# Applies to all 'register-docs' features across crates.
CLIPPY_FEATURES: '--features register-docs,godot/experimental-godot-api,godot/serde'
TEST_FEATURES: ''
RETRY: ${{ github.workspace }}/.github/other/retry.sh
# ASan options: https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
# LSan options: https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer
# * report_objects: list individual leaked objects when running LeakSanitizer
LSAN_OPTIONS: report_objects=1
CARGO_DENY_VERSION: "0.18.5"
CARGO_MACHETE_VERSION: "0.9.1"
defaults:
run:
shell: bash
# If a new commit is pushed before the old one's CI has completed (on the same branch), abort previous run
#concurrency:
# group: ${{ github.head_ref }}
# cancel-in-progress: true
jobs:
# For complex matrix workflow, see https://stackoverflow.com/a/65434401
godot-itest:
name: godot-itest (${{ matrix.name }})
runs-on: ${{ matrix.os }}
continue-on-error: false
timeout-minutes: 24
strategy:
fail-fast: false # cancel all jobs as soon as one fails?
matrix:
# Naming: {os}[-{runtimeVersion}]-{apiVersion}
# runtimeVersion = version of Godot binary; apiVersion = version of GDExtension API against which gdext is compiled.
# Config overview (see job for details).
#
# Cross-platform:
# - Base version: Godot nightly, no custom
# - Double precision: Godot nightly, custom (bindgen), double
# - 4.2 compat: Godot 4.2
#
# Linux-only:
# - Full: Godot nightly, full codegen
# - Double + lazy: Godot nightly, custom, double, lazy func tables
# - Features + exp: Godot nightly, custom, threads, serde, experimental API
# - Memcheck nightly: Godot mem nightly, custom, sanitizer
# - Memcheck 4.x: Godot mem 4.2, sanitizer
# Note: Windows uses '--target x86_64-pc-windows-msvc' by default as Cargo argument.
include:
# Uses full+experimental codegen, so that compatibility breakage towards nightly is detected.
# If the experimental part causes problems, consider using only godot/__codegen-full.
- name: linux-full
os: ubuntu-22.04
artifact-name: linux-nightly
godot-binary: godot.linuxbsd.editor.dev.x86_64
rust-extra-args: --features itest/codegen-full
hot-reload: api-custom
- name: linux-features-experimental
os: ubuntu-22.04
artifact-name: linux-nightly
godot-binary: godot.linuxbsd.editor.dev.x86_64
# Important to keep both experimental-threads and codegen-full. Some itests (native_st_audio) require both.
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde,itest/register-docs
- name: linux-release
os: ubuntu-22.04
artifact-name: linux-release-nightly
godot-binary: godot.linuxbsd.template_release.x86_64
# Use `codegen-full-experimental` to make sure that all function tables can be loaded in Godot release builds.
# If the experimental part causes problems, downgrade to `codegen-full`.
rust-extra-args: --release --features itest/codegen-full-experimental
rust-cache-key: release
# Memory checks: special Godot binaries compiled with AddressSanitizer/LeakSanitizer to detect UB/leaks.
# See also https://rustc-dev-guide.rust-lang.org/sanitizers.html.
#
# Additionally, the Godot source is patched to make dlclose() a no-op, as unloading dynamic libraries loses stacktrace and
# cause false positives like println!. See https://github.com/google/sanitizers/issues/89.
#
# There is also a gcc variant besides clang, which is currently not used.
- name: linux-memcheck-nightly
os: ubuntu-22.04
artifact-name: linux-memcheck-nightly
godot-binary: godot.linuxbsd.editor.dev.x86_64.llvm.san
rust-toolchain: nightly
rust-env-rustflags: -Zrandomize-layout -Zsanitizer=address
rust-extra-args: --features godot/api-custom
# Sanitizers can't build proc-macros and build scripts; with --target, cargo ignores RUSTFLAGS for those two.
rust-target: x86_64-unknown-linux-gnu
# To enable, this needs to rewrite .gdextension `debug` entry to the `release` dylib, otherwise we get error:
# mv: cannot stat 'target/x86_64-unknown-linux-gnu/debug': No such file or directory
#
- name: linux-memcheck-release-disengaged
os: ubuntu-22.04
artifact-name: linux-memcheck-nightly
godot-binary: godot.linuxbsd.editor.dev.x86_64.llvm.san
rust-toolchain: nightly
rust-env-rustflags: -Zrandomize-layout -Zsanitizer=address
# Currently without itest/codegen-full-experimental.
rust-extra-args: --release --features godot/safeguards-release-disengaged
rust-target: x86_64-unknown-linux-gnu
rust-target-dir: release # We're running Godot debug build with Rust release dylib.
- name: linux-memcheck-dev-balanced
os: ubuntu-22.04
artifact-name: linux-memcheck-nightly
godot-binary: godot.linuxbsd.editor.dev.x86_64.llvm.san
rust-toolchain: nightly
rust-env-rustflags: -Zrandomize-layout -Zsanitizer=address
# Currently without itest/codegen-full-experimental.
rust-extra-args: --features godot/safeguards-dev-balanced
rust-target: x86_64-unknown-linux-gnu
- name: linux-memcheck-4.2
os: ubuntu-22.04
artifact-name: linux-memcheck-4.2
godot-binary: godot.linuxbsd.editor.dev.x86_64.llvm.san
godot-prebuilt-patch: '4.2' # check compat of API 4.2 with newer binaries.
rust-toolchain: nightly
rust-env-rustflags: -Zrandomize-layout -Zsanitizer=address
# Sanitizers can't build proc-macros and build scripts; with --target, cargo ignores RUSTFLAGS for those two.
rust-target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- name: "Run Godot integration test"
uses: ./.github/composite/godot-itest
with:
artifact-name: godot-${{ matrix.artifact-name }}
godot-binary: ${{ matrix.godot-binary }}
godot-args: ${{ matrix.godot-args }} # currently unused
godot-prebuilt-patch: ${{ matrix.godot-prebuilt-patch }}
rust-extra-args: ${{ matrix.rust-extra-args }}
rust-toolchain: ${{ matrix.rust-toolchain || 'stable' }}
rust-env-rustflags: ${{ matrix.rust-env-rustflags }}
rust-target: ${{ matrix.rust-target }}
rust-target-dir: ${{ matrix.rust-target-dir }}
rust-cache-key: ${{ matrix.rust-cache-key }}
with-llvm: ${{ contains(matrix.name, 'macos') && contains(matrix.rust-extra-args, 'api-custom') }}
godot-check-header: ${{ matrix.godot-check-header }}
godot-indirect-json: ${{ matrix.godot-indirect-json }}
- name: "Build and test hot-reload"
if: ${{ matrix.hot-reload }}
working-directory: itest/hot-reload/godot
# Repeat a few times, our hot reload integration test can sometimes be a bit flaky.
# Don't pass in rust-extra-args as environment; they're intended for itest.
run: $RETRY ./run-test.sh ${{ matrix.hot-reload }}
shell: bash