CI iterate5 #2416
Workflow file for this run
This file contains hidden or 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
| # 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 |