From 127203d5619b8fa3f404f4eb1e2eb8653f6e642e Mon Sep 17 00:00:00 2001 From: Jan Haller Date: Sat, 28 Jan 2023 15:20:55 +0100 Subject: [PATCH] CI #2 --- .../action.yml | 4 ++- .../{itest-godot => godot-itest}/action.yml | 12 ++++--- .github/composite/rust/action.yml | 11 +++++++ .github/workflows/full-ci.yml | 33 ++++++++++--------- .github/workflows/minimal-ci.yml | 24 ++++++++------ 5 files changed, 52 insertions(+), 32 deletions(-) rename .github/composite/{install-godot => godot-install}/action.yml (93%) rename .github/composite/{itest-godot => godot-itest}/action.yml (96%) diff --git a/.github/composite/install-godot/action.yml b/.github/composite/godot-install/action.yml similarity index 93% rename from .github/composite/install-godot/action.yml rename to .github/composite/godot-install/action.yml index d79b708e4..68998d4bd 100644 --- a/.github/composite/install-godot/action.yml +++ b/.github/composite/godot-install/action.yml @@ -39,7 +39,9 @@ runs: - name: "Download Godot artifact" # if: steps.cache-godot.outputs.cache-hit != 'true' run: | - curl https://nightly.link/Bromeon/godot4-nightly/workflows/compile-godot/master/${{ inputs.artifact-name }}.zip -Lo artifact.zip + curl https://nightly.link/Bromeon/godot4-nightly/workflows/compile-godot/master/${{ inputs.artifact-name }}.zip \ + -Lo artifact.zip \ + --retry 3 unzip artifact.zip -d $RUNNER_DIR/godot_bin shell: bash diff --git a/.github/composite/itest-godot/action.yml b/.github/composite/godot-itest/action.yml similarity index 96% rename from .github/composite/itest-godot/action.yml rename to .github/composite/godot-itest/action.yml index 99e11317e..1b1466353 100644 --- a/.github/composite/itest-godot/action.yml +++ b/.github/composite/godot-itest/action.yml @@ -24,6 +24,11 @@ inputs: default: '' description: "Extra command line arguments for 'cargo build', e.g. features" + with-llvm: + required: false + description: "Set to 'true' if LLVM should be installed" + default: '' + runs: using: "composite" @@ -31,7 +36,7 @@ runs: - uses: actions/checkout@v3 - name: "Install Godot" - uses: ./.github/composite/install-godot + uses: ./.github/composite/godot-install with: artifact-name: ${{ inputs.artifact-name }} binary-filename: ${{ inputs.binary-filename }} @@ -72,10 +77,7 @@ runs: uses: ./.github/composite/rust with: rust: ${{ inputs.rust-toolchain }} - - - name: "Install LLVM" - uses: ./.github/composite/llvm - # TODO only run it on systems needed + with-llvm: ${{ inputs.with-llvm }} - name: "Build godot-rust" run: | diff --git a/.github/composite/rust/action.yml b/.github/composite/rust/action.yml index df105b25b..1b4e59ea5 100644 --- a/.github/composite/rust/action.yml +++ b/.github/composite/rust/action.yml @@ -10,15 +10,22 @@ inputs: required: false description: "Rust toolchain, e.g. 'stable' or 'nightly'" default: stable + components: required: false description: "Components array" default: '' + cache-key: required: false description: "Extra key to resolve cache" default: '' + with-llvm: + required: false + description: "Set to 'true' if LLVM should be installed" + default: '' + runs: using: "composite" steps: @@ -41,6 +48,10 @@ runs: with: shared-key: ${{ inputs.cache-key }} + - name: "Install LLVM" + uses: ./.github/composite/llvm + if: ${{ inputs.with-llvm == 'true' }} + - name: "Set environment variables used by toolchain" run: | echo CARGO_TERM_COLOR=always >> $GITHUB_ENV diff --git a/.github/workflows/full-ci.yml b/.github/workflows/full-ci.yml index 4bd21a879..1448843d3 100644 --- a/.github/workflows/full-ci.yml +++ b/.github/workflows/full-ci.yml @@ -15,7 +15,7 @@ on: env: GDEXT_FEATURES: 'godot-core/convenience' - GDEXT_CRATE_ARGS: '-p godot-codegen -p godot-ffi -p godot-core -p godot-macros -p godot' +# GDEXT_CRATE_ARGS: '-p godot-codegen -p godot-ffi -p godot-core -p godot-macros -p godot' defaults: run: @@ -53,17 +53,17 @@ jobs: # TODO get rid of Godot binary, once the JSON is either versioned or fetched from somewhere # Replaces also backspaces on Windows, since they cause problems in Bash - name: "Install Godot" - uses: ./.github/composite/install-godot + uses: ./.github/composite/godot-install with: artifact-name: godot-linux binary-filename: godot.linuxbsd.editor.dev.x86_64 - name: "Check clippy" - 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 + run: cargo clippy -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented unit-test: - name: unit-test (${{ matrix.name }}) + name: unit-test (${{ matrix.name }}${{ matrix.rust-special }}) runs-on: ${{ matrix.os }} continue-on-error: false strategy: @@ -90,10 +90,10 @@ jobs: rust-toolchain: stable godot-binary: godot.linuxbsd.editor.dev.x86_64 - - name: linux-minimal-deps + - name: linux os: ubuntu-20.04 rust-toolchain: stable - rust-special: minimal-deps + rust-special: -minimal-deps godot-binary: godot.linuxbsd.editor.dev.x86_64 steps: @@ -104,35 +104,36 @@ jobs: with: rust: stable cache-key: ${{ matrix.rust-special }} # 'minimal-deps' or empty/not defined + with-llvm: ${{ matrix.name == 'macos' }} - name: "Install Rust nightly (minimal deps)" uses: ./.github/composite/rust with: rust: nightly cache-key: minimal-deps-nightly - if: ${{ matrix.rust-special == 'minimal-deps' }} + if: ${{ matrix.rust-special == '-minimal-deps' }} - name: "Install minimal dependency versions from Cargo" run: cargo +nightly update -Z minimal-versions - if: ${{ matrix.rust-special == 'minimal-deps' }} + if: ${{ matrix.rust-special == '-minimal-deps' }} # TODO get rid of Godot binary, once the JSON is either versioned or fetched from somewhere # Replaces also backspaces on Windows, since they cause problems in Bash - name: "Install Godot" - uses: ./.github/composite/install-godot + uses: ./.github/composite/godot-install with: artifact-name: godot-${{ matrix.name }} binary-filename: ${{ matrix.godot-binary }} - name: "Compile tests" - run: cargo test $GDEXT_CRATE_ARGS --features $GDEXT_FEATURES --no-run + run: cargo test --no-run - name: "Test" - run: cargo test $GDEXT_CRATE_ARGS --features $GDEXT_FEATURES + run: cargo test - itest-godot: - name: itest-godot (${{ matrix.name }}) + godot-itest: + name: godot-itest (${{ matrix.name }}) runs-on: ${{ matrix.os }} continue-on-error: false timeout-minutes: 24 @@ -164,11 +165,11 @@ jobs: - uses: actions/checkout@v3 - name: "Run Godot integration test" - uses: ./.github/composite/itest-godot + uses: ./.github/composite/godot-itest with: artifact-name: godot-${{ matrix.name }} binary-filename: ${{ matrix.godot-binary }} - #godot_ver: ${{ matrix.godot }} + with-llvm: ${{ matrix.name == 'macos' }} license-guard: @@ -193,7 +194,7 @@ jobs: - rustfmt - clippy - unit-test - - itest-godot + - godot-itest - license-guard runs-on: ubuntu-20.04 steps: diff --git a/.github/workflows/minimal-ci.yml b/.github/workflows/minimal-ci.yml index 41ad80752..dd64a58a5 100644 --- a/.github/workflows/minimal-ci.yml +++ b/.github/workflows/minimal-ci.yml @@ -53,7 +53,7 @@ jobs: # TODO get rid of Godot binary, once the JSON is either versioned or fetched from somewhere # Replaces also backspaces on Windows, since they cause problems in Bash - name: "Install Godot" - uses: ./.github/composite/install-godot + uses: ./.github/composite/godot-install with: artifact-name: godot-linux binary-filename: godot.linuxbsd.editor.dev.x86_64 @@ -71,26 +71,30 @@ jobs: - name: "Install Rust" uses: ./.github/composite/rust + # TODO get rid of Godot binary, once the JSON is either versioned or fetched from somewhere + # Replaces also backspaces on Windows, since they cause problems in Bash + - name: "Install Godot" + uses: ./.github/composite/godot-install + with: + artifact-name: godot-${{ matrix.name }} + binary-filename: ${{ matrix.godot-binary }} + - name: "Compile tests" - run: cargo test $GDEXT_CRATE_ARGS --features $GDEXT_FEATURES --no-run - env: - RUSTFLAGS: --cfg=gdext_test + run: cargo test --no-run - name: "Test" - run: cargo test $GDEXT_CRATE_ARGS --features $GDEXT_FEATURES - env: - RUSTFLAGS: --cfg=gdext_test + run: cargo test - itest-godot: - name: itest-godot + godot-itest: + name: godot-itest runs-on: ubuntu-20.04 timeout-minutes: 24 steps: - uses: actions/checkout@v3 - name: "Run Godot integration test" - uses: ./.github/composite/itest-godot + uses: ./.github/composite/godot-itest with: artifact-name: godot-linux binary-filename: godot.linuxbsd.editor.dev.x86_64