-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,6 @@ on: | |
merge_group: | ||
push: | ||
branches: | ||
- staging | ||
- trying | ||
|
||
env: | ||
GDEXT_FEATURES: '' | ||
|
@@ -34,113 +32,6 @@ defaults: | |
# cancel-in-progress: true | ||
|
||
jobs: | ||
rustfmt: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: "Install Rust" | ||
uses: ./.github/composite/rust | ||
with: | ||
components: rustfmt | ||
|
||
- name: "Check rustfmt" | ||
run: cargo fmt --all -- --check | ||
|
||
|
||
# Needs to be its own job (apart from sync-doc), because lints don't work with --no-deps, and because it contributes to ci-status. | ||
doc-lints: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: "Install Rust" | ||
uses: ./.github/composite/rust | ||
with: | ||
components: rustdoc | ||
|
||
- name: "Check rustdoc" | ||
env: | ||
RUSTDOCFLAGS: > | ||
-D rustdoc::broken-intra-doc-links -D rustdoc::private-intra-doc-links -D rustdoc::invalid-codeblock-attributes | ||
-D rustdoc::invalid-rust-codeblocks -D rustdoc::invalid-html-tags -D rustdoc::bare-urls -D rustdoc::unescaped-backticks | ||
run: cargo doc -p godot | ||
|
||
|
||
clippy: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: "Install Rust" | ||
uses: ./.github/composite/rust | ||
with: | ||
components: clippy | ||
|
||
# Note: could use `-- --no-deps` to not lint dependencies, however it doesn't really speed up and also skips deps in workspace. | ||
- name: "Check clippy" | ||
run: | | ||
cargo clippy --all-targets $GDEXT_FEATURES -- \ | ||
-D clippy::suspicious \ | ||
-D clippy::style \ | ||
-D clippy::complexity \ | ||
-D clippy::perf \ | ||
-D clippy::dbg_macro \ | ||
-D clippy::todo \ | ||
-D clippy::unimplemented \ | ||
-D warnings | ||
unit-test: | ||
name: unit-test (${{ matrix.name }}${{ matrix.rust-special }}) | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: false | ||
strategy: | ||
fail-fast: false # cancel all jobs as soon as one fails? | ||
matrix: | ||
# Order this way because macOS typically has the longest duration, followed by Windows, so it benefits total workflow execution time. | ||
# Additionally, the 'linux (msrv *)' special case will then be listed next to the other 'linux' jobs. | ||
# Note: Windows uses '--target x86_64-pc-windows-msvc' by default as Cargo argument. | ||
include: | ||
- name: macos | ||
os: macos-11 | ||
|
||
- name: windows | ||
os: windows-latest | ||
|
||
# Don't use latest Ubuntu (22.04) as it breaks lots of ecosystem compatibility. | ||
# If ever moving to ubuntu-latest, need to manually install libtinfo5 for LLVM. | ||
- name: linux | ||
os: ubuntu-20.04 | ||
|
||
- name: linux | ||
os: ubuntu-20.04 | ||
rust-toolchain: nightly | ||
rust-special: -minimal-deps | ||
rust-cache-key: minimal-deps | ||
|
||
- name: linux | ||
os: ubuntu-20.04 | ||
rust-toolchain: '1.70.0' | ||
rust-special: -msrv | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: "Install Rust" | ||
uses: ./.github/composite/rust | ||
with: | ||
rust: ${{ matrix.rust-toolchain || 'stable' }} | ||
cache-key: ${{ matrix.rust-cache-key }} # only needed when rustc version is possibly the same | ||
|
||
- name: "Install minimal dependency versions from Cargo" | ||
if: matrix.rust-special == '-minimal-deps' | ||
run: cargo +nightly update -Z minimal-versions | ||
|
||
- name: "Compile tests" | ||
run: cargo test $GDEXT_FEATURES --no-run ${{ matrix.rust-extra-args }} | ||
|
||
- name: "Test" | ||
run: cargo test $GDEXT_FEATURES ${{ matrix.rust-extra-args }} | ||
|
||
# For complex matrix workflow, see https://stackoverflow.com/a/65434401 | ||
godot-itest: | ||
|
@@ -160,23 +51,65 @@ jobs: | |
include: | ||
# macOS | ||
|
||
- name: macos | ||
- name: macos-0 | ||
os: macos-12 | ||
artifact-name: macos-nightly | ||
godot-binary: godot.macos.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: macos-double | ||
- name: macos-1 | ||
os: macos-12 | ||
artifact-name: macos-double-nightly | ||
godot-binary: godot.macos.editor.dev.double.x86_64 | ||
rust-extra-args: --features godot/custom-godot,godot/double-precision | ||
artifact-name: macos-nightly | ||
godot-binary: godot.macos.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: macos-4.1 | ||
- name: macos-2 | ||
os: macos-12 | ||
artifact-name: macos-stable | ||
artifact-name: macos-nightly | ||
godot-binary: godot.macos.editor.dev.x86_64 | ||
#godot-prebuilt-patch: '4.1' | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: macos-3 | ||
os: macos-12 | ||
artifact-name: macos-nightly | ||
godot-binary: godot.macos.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: macos-4 | ||
os: macos-12 | ||
artifact-name: macos-nightly | ||
godot-binary: godot.macos.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: macos-5 | ||
os: macos-12 | ||
artifact-name: macos-nightly | ||
godot-binary: godot.macos.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: macos-6 | ||
os: macos-12 | ||
artifact-name: macos-nightly | ||
godot-binary: godot.macos.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: macos-7 | ||
os: macos-12 | ||
artifact-name: macos-nightly | ||
godot-binary: godot.macos.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: macos-8 | ||
os: macos-12 | ||
artifact-name: macos-nightly | ||
godot-binary: godot.macos.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: macos-9 | ||
os: macos-12 | ||
artifact-name: macos-nightly | ||
godot-binary: godot.macos.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
# Windows | ||
|
||
|
@@ -186,18 +119,6 @@ jobs: | |
godot-binary: godot.windows.editor.dev.x86_64.exe | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: windows-double | ||
os: windows-latest | ||
artifact-name: windows-double-nightly | ||
godot-binary: godot.windows.editor.dev.double.x86_64.exe | ||
rust-extra-args: --features godot/custom-godot,godot/double-precision | ||
|
||
- name: windows-4.1 | ||
os: windows-latest | ||
artifact-name: windows-stable | ||
godot-binary: godot.windows.editor.dev.x86_64.exe | ||
#godot-prebuilt-patch: '4.1' | ||
|
||
# Linux | ||
|
||
# Don't use latest Ubuntu (22.04) as it breaks lots of ecosystem compatibility. | ||
|
@@ -208,66 +129,6 @@ jobs: | |
godot-binary: godot.linuxbsd.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot | ||
|
||
- name: linux-double | ||
os: ubuntu-20.04 | ||
artifact-name: linux-double-nightly | ||
godot-binary: godot.linuxbsd.editor.dev.double.x86_64 | ||
rust-extra-args: --features godot/custom-godot,godot/double-precision | ||
|
||
- name: linux-features | ||
os: ubuntu-20.04 | ||
artifact-name: linux-nightly | ||
godot-binary: godot.linuxbsd.editor.dev.x86_64 | ||
rust-extra-args: --features godot/custom-godot,godot/experimental-threads,godot/serde | ||
|
||
# Linux compat | ||
|
||
- name: linux-4.1.1 | ||
os: ubuntu-20.04 | ||
artifact-name: linux-stable | ||
godot-binary: godot.linuxbsd.editor.dev.x86_64 | ||
#godot-prebuilt-patch: '4.1.1' | ||
|
||
- name: linux-4.1 | ||
os: ubuntu-20.04 | ||
artifact-name: linux-stable | ||
godot-binary: godot.linuxbsd.editor.dev.x86_64 | ||
godot-prebuilt-patch: '4.1' | ||
|
||
- name: linux-4.0.4 | ||
os: ubuntu-20.04 | ||
artifact-name: linux-4.0.4 | ||
godot-binary: godot.linuxbsd.editor.dev.x86_64 | ||
godot-prebuilt-patch: '4.0.4' | ||
|
||
|
||
# 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 | ||
os: ubuntu-20.04 | ||
artifact-name: linux-memcheck-clang-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/custom-godot | ||
# Sanitizers can't build proc-macros and build scripts; with --target, cargo ignores RUSTFLAGS for those two. | ||
rust-target: x86_64-unknown-linux-gnu | ||
|
||
- name: linux-memcheck-4.0.4 | ||
os: ubuntu-20.04 | ||
artifact-name: linux-memcheck-clang-4.0.4 | ||
godot-binary: godot.linuxbsd.editor.dev.x86_64.llvm.san | ||
godot-prebuilt-patch: '4.0.4' | ||
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@v3 | ||
|
||
|
@@ -286,21 +147,6 @@ jobs: | |
godot-check-header: ${{ matrix.godot-check-header }} | ||
|
||
|
||
license-guard: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: "Check license headers" | ||
uses: apache/skywalking-eyes/[email protected] | ||
with: | ||
# log: debug # optional: set the log level. The default value is `info`. | ||
config: .github/other/licenserc.yml | ||
# token: # optional: the token that license eye uses when it needs to comment on the pull request. | ||
# Set to empty ("") to disable commenting on pull request. The default value is ${{ github.token }} | ||
# mode: # optional: Which mode License-Eye should be run in. Choices are `check` or `fix`. The default value is `check`. | ||
mode: check | ||
|
||
|
||
# --------------------------------------------------------------------------------------------------------------------------------------------- | ||
# CI status report | ||
|
@@ -310,12 +156,7 @@ jobs: | |
ci-status: | ||
if: always() && (github.event_name == 'merge_group' || github.event_name == 'push') | ||
needs: | ||
- rustfmt | ||
- doc-lints | ||
- clippy | ||
- unit-test | ||
- godot-itest | ||
- license-guard | ||
|
||
runs-on: ubuntu-20.04 | ||
steps: | ||
|