From 29de62db01527d63988f5e87b18ea6a125423ff3 Mon Sep 17 00:00:00 2001 From: Fulvio Venturelli Date: Tue, 10 Sep 2024 16:08:06 +0200 Subject: [PATCH] CI: move rusk binary copy to separate CI action --- .github/workflows/binary_copy.yml | 50 +++++++++++++++++++++++++++++++ .github/workflows/rusk_ci.yml | 20 +------------ 2 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/binary_copy.yml diff --git a/.github/workflows/binary_copy.yml b/.github/workflows/binary_copy.yml new file mode 100644 index 0000000000..69ed40db60 --- /dev/null +++ b/.github/workflows/binary_copy.yml @@ -0,0 +1,50 @@ +name: Rusk binary copy + +on: + push: + branches: + - master + +jobs: + # Job to run change detection + changes: + runs-on: core + permissions: + pull-requests: read + outputs: + run-ci: ${{ steps.filter.outputs.run-ci }} + steps: + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + run-ci: + - 'rusk/**' + - 'node/**' + - '.github/workflows/binary_copy.yml' + build: + needs: changes + if: needs.changes.outputs.run-ci == 'true' + name: Make rusk + runs-on: core + steps: + - uses: actions/checkout@v4 + - uses: dsherret/rust-toolchain-file@v1 + - run: make + copy_to_host: + needs: build + runs-on: core + continue-on-error: true + steps: + - name: "Check and Copy Rusk Artifact to Host" + run: | + # Ensure the target directory exists + mkdir -p /var/opt/rusk-artifacts + + # Check if the rusk artifact exists before copying + if [ -f ./target/release/rusk ]; then + echo "Rusk artifact found. Copying to host." + cp ./target/release/rusk /var/opt/rusk-artifacts + else + echo "Rusk artifact not found. Skipping copy." + fi diff --git a/.github/workflows/rusk_ci.yml b/.github/workflows/rusk_ci.yml index 9418167842..754779ecb1 100644 --- a/.github/workflows/rusk_ci.yml +++ b/.github/workflows/rusk_ci.yml @@ -75,22 +75,4 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dsherret/rust-toolchain-file@v1 - - run: cargo fmt --all -- --check - copy_to_host: - needs: test_nightly - runs-on: core - if: needs.test_nightly.result == 'success' && github.base_ref == 'main' - continue-on-error: true - steps: - - name: "Check and Copy Rusk Artifact to Host" - run: | - # Ensure the target directory exists - mkdir -p /var/opt/rusk-artifacts - - # Check if the rusk artifact exists before copying - if [ -f ./target/release/rusk ]; then - echo "Rusk artifact found. Copying to host." - cp ./target/release/rusk /var/opt/rusk-artifacts - else - echo "Rusk artifact not found. Skipping copy." - fi \ No newline at end of file + - run: cargo fmt --all -- --check \ No newline at end of file