Skip to content

Commit

Permalink
CI #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Jan 28, 2023
1 parent 800e834 commit 127203d
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ 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"
steps:
- 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 }}
Expand Down Expand Up @@ -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: |
Expand Down
11 changes: 11 additions & 0 deletions .github/composite/rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
33 changes: 17 additions & 16 deletions .github/workflows/full-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -193,7 +194,7 @@ jobs:
- rustfmt
- clippy
- unit-test
- itest-godot
- godot-itest
- license-guard
runs-on: ubuntu-20.04
steps:
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/minimal-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 127203d

Please sign in to comment.