From a00c2467dea47342c81ceabbf80c62f13906b7c0 Mon Sep 17 00:00:00 2001 From: HDauven Date: Wed, 22 Nov 2023 16:32:52 +0100 Subject: [PATCH 1/3] Rename rust-toolchain file --- rust-toolchain | 1 - rust-toolchain.toml | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 rust-toolchain create mode 100644 rust-toolchain.toml diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index c309192209..0000000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly-2023-05-22 diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000..0a2e31fdb5 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "nightly-2023-05-22" +targets = ["wasm32-unknown-unknown"] +components = ["rust-src", "rustfmt", "cargo", "clippy"] \ No newline at end of file From e923b21e9582130fa305500687e86c6ae95628cb Mon Sep 17 00:00:00 2001 From: HDauven Date: Wed, 22 Nov 2023 16:33:11 +0100 Subject: [PATCH 2/3] Update workflow files Update all actions to the latest versions and replace the no longer maintained actions-rs actions. --- .github/workflows/docker_image_build.yml | 6 ++-- .github/workflows/dusk_ci.yml | 39 ++++++------------------ .github/workflows/profile_ci.yml | 12 +++----- .github/workflows/wallet_build.yml | 9 ++---- 4 files changed, 19 insertions(+), 47 deletions(-) diff --git a/.github/workflows/docker_image_build.yml b/.github/workflows/docker_image_build.yml index 58394d4b0c..e6a4c8d01a 100644 --- a/.github/workflows/docker_image_build.yml +++ b/.github/workflows/docker_image_build.yml @@ -9,10 +9,10 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build Docker image run: docker build -t rusk . @@ -21,7 +21,7 @@ jobs: run: docker save rusk:latest -o rusk_image.tar - name: Upload Docker image as artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: rusk-image path: rusk_image.tar diff --git a/.github/workflows/dusk_ci.yml b/.github/workflows/dusk_ci.yml index f43bac0710..5d2786ca9b 100644 --- a/.github/workflows/dusk_ci.yml +++ b/.github/workflows/dusk_ci.yml @@ -7,30 +7,17 @@ jobs: name: Dusk Analyzer runs-on: core steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - - uses: actions-rs/cargo@v1 - with: - command: install - args: --git https://github.com/dusk-network/cargo-dusk-analyzer - - uses: actions-rs/cargo@v1 - with: - command: dusk-analyzer + - uses: actions/checkout@v4 + - uses: dsherret/rust-toolchain-file@v1 + - run: cargo install --git https://github.com/dusk-network/cargo-dusk-analyzer + - run: cargo dusk-analyzer test_nightly: name: Nightly tests runs-on: core steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - - run: rustup component add rustfmt - - run: rustup target add wasm32-unknown-unknown - - run: rustup component add rust-src + - uses: actions/checkout@v4 + - uses: dsherret/rust-toolchain-file@v1 - run: > RUSK_PROFILE_PATH="/var/opt/build-cache" RUSK_KEEP_KEYS="1" @@ -42,7 +29,7 @@ jobs: RUSK_PROFILE_PATH: "/var/opt/build-cache" run: make clippy - name: "Upload Rusk Artifact" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: rusk-artifact path: ./target/release/rusk @@ -51,12 +38,6 @@ jobs: name: Rustfmt runs-on: core steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - - run: rustup component add rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - uses: actions/checkout@v4 + - uses: dsherret/rust-toolchain-file@v1 + - run: cargo fmt --all -- --check diff --git a/.github/workflows/profile_ci.yml b/.github/workflows/profile_ci.yml index 1aa2a507d1..0c6f4e622b 100644 --- a/.github/workflows/profile_ci.yml +++ b/.github/workflows/profile_ci.yml @@ -6,10 +6,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cache .rusk profile - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-rusk-profile-v2 with: @@ -17,10 +17,6 @@ jobs: key: ${{ runner.os }}-build-${{ env.cache-name }} restore-keys: ${{ runner.os }}-build-${{ env.cache-name }} - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - # This should not be required. But the workflow fails if we don't include it - - run: rustup component add rustfmt + - uses: actions/checkout@v4 + - uses: dsherret/rust-toolchain-file@v1 - run: RUSK_PROFILE_PATH=$GITHUB_WORKSPACE make keys diff --git a/.github/workflows/wallet_build.yml b/.github/workflows/wallet_build.yml index 2890a917f3..7a4d1a0c28 100644 --- a/.github/workflows/wallet_build.yml +++ b/.github/workflows/wallet_build.yml @@ -31,17 +31,12 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.dusk_blockchain_ref }} - name: Install dependencies - uses: actions-rs/toolchain@v1 - with: - profile: minimal - - - name: Add rustfmt component - run: rustup component add rustfmt + uses: dsherret/rust-toolchain-file@v1 - name: Build Rusk binary shell: bash From 0265cab96c365da42b7cc9d474ba48a353b45f59 Mon Sep 17 00:00:00 2001 From: HDauven Date: Wed, 22 Nov 2023 17:04:28 +0100 Subject: [PATCH 3/3] Remove wallet build CI flow --- .github/workflows/wallet_build.yml | 67 ------------------------------ 1 file changed, 67 deletions(-) delete mode 100644 .github/workflows/wallet_build.yml diff --git a/.github/workflows/wallet_build.yml b/.github/workflows/wallet_build.yml deleted file mode 100644 index 7a4d1a0c28..0000000000 --- a/.github/workflows/wallet_build.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Compile CLI wallet binaries - -on: - workflow_dispatch: - inputs: - dusk_blockchain_ref: - description: "GIT branch, ref, or SHA to checkout" - required: true - default: "master" - -defaults: - run: - shell: bash - -jobs: - build_and_publish: - name: Build rusk-wallet binaries for ${{ matrix.os }} with ${{ matrix.compiler }}. - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - compiler: [cargo] - include: - - os: ubuntu-latest - compiler: cargo - target: linux-x64 - - - os: macos-latest - compiler: cargo - target: macos-intel - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.dusk_blockchain_ref }} - - - name: Install dependencies - uses: dsherret/rust-toolchain-file@v1 - - - name: Build Rusk binary - shell: bash - working-directory: ./rusk - run: ${{matrix.compiler}} b --release --verbose -p rusk-wallet - - - name: Get semver from wallet binary - run: | - export SEMVER=$(./target/release/rusk-wallet --version | perl -lpe 's/\w+\s\w+\s\w+\s(.*?)/$1/') - echo "SEMVER=$SEMVER" >> $GITHUB_ENV - - - name: "Pack binaries" - run: | - mkdir rusk-wallet${{env.SEMVER}}-${{matrix.target}} - echo "Fetching changelog and readme files..." - mv target/release/rusk-wallet rusk-wallet${{env.SEMVER}}-${{matrix.target}} - cp rusk-wallet/CHANGELOG.md rusk-wallet${{env.SEMVER}}-${{matrix.target}} - cp rusk-wallet/README.md rusk-wallet${{env.SEMVER}}-${{matrix.target}} - tar -czvf ruskwallet${{env.SEMVER}}-${{matrix.target}}.tar.gz rusk-wallet${{env.SEMVER}}-${{matrix.target}} - ls -la *.gz - - - name: "Upload Wallet Artifacts" - uses: actions/upload-artifact@v3 - with: - name: wallet-binaries-${{env.SEMVER}} - path: | - ./*.gz - retention-days: 5