Skip to content

Commit

Permalink
Remove Godot from CI where possible (clippy, test)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Apr 1, 2023
1 parent c20197f commit 0493907
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 94 deletions.
4 changes: 2 additions & 2 deletions .github/composite/llvm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
- name: "Cache LLVM and clang"
id: cache-llvm
# Note: conditionals not yet supported; see https://github.com/actions/runner/issues/834
# if: ${{ inputs.llvm == 'true' }}
# if: inputs.llvm == 'true'
uses: actions/cache@v3
with:
# path: |
Expand All @@ -34,7 +34,7 @@ runs:
key: llvm-10.0

- uses: KyleMayes/install-llvm-action@v1
# if: ${{ inputs.llvm == 'true' }}
# if: inputs.llvm == 'true'
with:
version: "10.0"
directory: ${{ env.LLVM_INSTALL_DIR }}
Expand Down
2 changes: 1 addition & 1 deletion .github/composite/rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ runs:
cache-on-failure: true

- name: "Install LLVM"
if: inputs.with-llvm == 'true'
uses: ./.github/composite/llvm
if: ${{ inputs.with-llvm == 'true' }}

- name: "Set environment variables used by toolchain"
run: |
Expand Down
76 changes: 13 additions & 63 deletions .github/workflows/full-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,49 +42,28 @@ jobs:
- name: "Install Rust"
uses: ./.github/composite/rust
with:
rust: stable
components: rustfmt

- name: "Check rustfmt"
run: cargo fmt --all -- --check


clippy:
name: clippy (${{ matrix.name }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- name: linux
rust-toolchain: stable
godot-binary: godot.linuxbsd.editor.dev.x86_64

- name: linux-double
rust-toolchain: stable
godot-binary: godot.linuxbsd.editor.dev.double.x86_64
rust-extra-args: --features double-precision
steps:
- uses: actions/checkout@v3

- 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 }}
godot-binary: ${{ matrix.godot-binary }}
components: clippy

- name: "Check clippy"
run: |
cargo clippy --all-targets $GDEXT_FEATURES ${{ matrix.rust-extra-args }} -- \
-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 }}
Expand All @@ -98,28 +77,19 @@ jobs:
include:
- name: macos
os: macos-11
rust-toolchain: stable
godot-binary: godot.macos.editor.dev.x86_64
with-llvm: true

- name: windows
os: windows-latest
rust-toolchain: stable-x86_64-pc-windows-msvc
godot-binary: godot.windows.editor.dev.x86_64.exe

# 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
rust-toolchain: stable
godot-binary: godot.linuxbsd.editor.dev.x86_64

- name: linux
os: ubuntu-20.04
rust-toolchain: stable
rust-special: -minimal-deps
godot-binary: godot.linuxbsd.editor.dev.x86_64


steps:
- uses: actions/checkout@v3

Expand All @@ -128,26 +98,17 @@ jobs:
with:
rust: stable
cache-key: ${{ matrix.rust-special }} # '-minimal-deps' or empty/not defined
with-llvm: ${{ matrix.with-llvm }}

- name: "Install Rust nightly (minimal deps)"
if: matrix.rust-special == '-minimal-deps'
uses: ./.github/composite/rust
with:
rust: nightly
cache-key: minimal-deps-nightly
if: ${{ matrix.rust-special == '-minimal-deps' }}

- name: "Install minimal dependency versions from Cargo"
if: matrix.rust-special == '-minimal-deps'
run: cargo +nightly update -Z minimal-versions
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/godot-install
with:
artifact-name: godot-${{ matrix.name }}
godot-binary: ${{ matrix.godot-binary }}

- name: "Compile tests"
run: cargo test $GDEXT_FEATURES --no-run ${{ matrix.rust-extra-args }}
Expand All @@ -170,60 +131,49 @@ jobs:
include:
- name: macos
os: macos-12
rust-toolchain: stable
godot-binary: godot.macos.editor.dev.x86_64
with-llvm: true


- name: macos-double
os: macos-12
rust-toolchain: stable
godot-binary: godot.macos.editor.dev.double.x86_64
rust-extra-args: --features double-precision
with-llvm: true

- name: macos-bindgen
artifact-name: macos
- name: macos-nightly
os: macos-12
rust-toolchain: stable
artifact-name: macos
godot-binary: godot.macos.editor.dev.x86_64
with-llvm: true
rust-extra-args: --features godot/custom-godot
with-llvm: true

- name: windows
os: windows-latest
rust-toolchain: stable-x86_64-pc-windows-msvc
godot-binary: godot.windows.editor.dev.x86_64.exe

- name: windows-double
os: windows-latest
rust-toolchain: stable-x86_64-pc-windows-msvc
godot-binary: godot.windows.editor.dev.double.x86_64.exe
rust-extra-args: --features double-precision

- name: windows-bindgen
artifact-name: windows
- name: windows-nightly
os: windows-latest
rust-toolchain: stable-x86_64-pc-windows-msvc
artifact-name: windows
godot-binary: godot.windows.editor.dev.x86_64.exe
rust-extra-args: --features godot/custom-godot

# 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
rust-toolchain: stable
godot-binary: godot.linuxbsd.editor.dev.x86_64

- name: linux-double
os: ubuntu-20.04
rust-toolchain: stable
godot-binary: godot.linuxbsd.editor.dev.double.x86_64
rust-extra-args: --features double-precision

- name: linux-bindgen
artifact-name: linux
- name: linux-nightly
os: ubuntu-20.04
rust-toolchain: stable
artifact-name: linux
godot-binary: godot.linuxbsd.editor.dev.x86_64
rust-extra-args: --features godot/custom-godot

Expand Down Expand Up @@ -257,7 +207,7 @@ jobs:
godot-binary: ${{ matrix.godot-binary }}
godot-args: ${{ matrix.godot-args }}
rust-extra-args: ${{ matrix.rust-extra-args }}
rust-toolchain: ${{ matrix.rust-toolchain }}
rust-toolchain: ${{ matrix.rust-toolchain || 'stable' }}
rust-env-rustflags: ${{ matrix.rust-env-rustflags }}
with-llvm: ${{ matrix.with-llvm }}
godot-check-header: ${{ matrix.name == 'linux' }}
Expand Down
30 changes: 2 additions & 28 deletions .github/workflows/minimal-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,21 @@ jobs:


clippy:
name: clippy (${{ matrix.name }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- name: linux
rust-toolchain: stable
godot-binary: godot.linuxbsd.editor.dev.x86_64

- name: linux-double
rust-toolchain: stable
godot-binary: godot.linuxbsd.editor.dev.double.x86_64
rust-extra-args: --features double-precision
steps:
- uses: actions/checkout@v3

- 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 }}
godot-binary: ${{ matrix.godot-binary }}
components: clippy

- name: "Check clippy"
run: |
cargo clippy --all-targets $GDEXT_FEATURES ${{ matrix.rust-extra-args }} -- \
-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
Expand All @@ -88,12 +69,6 @@ jobs:
- name: "Install Rust"
uses: ./.github/composite/rust

- name: "Install Godot"
uses: ./.github/composite/godot-install
with:
artifact-name: godot-linux
godot-binary: godot.linuxbsd.editor.dev.x86_64

- name: "Compile tests"
run: cargo test $GDEXT_FEATURES --no-run

Expand All @@ -113,7 +88,6 @@ jobs:
with:
artifact-name: godot-linux
godot-binary: godot.linuxbsd.editor.dev.x86_64
#godot_ver: ${{ matrix.godot }}


license-guard:
Expand Down

0 comments on commit 0493907

Please sign in to comment.