diff --git a/.github/scripts/install_test_binaries.sh b/.github/scripts/install_test_binaries.sh deleted file mode 100755 index 39a1f86..0000000 --- a/.github/scripts/install_test_binaries.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -# Installs Solc and Geth binaries -# Note: intended for use only with CI (x86_64 Ubuntu, MacOS or Windows) -set -e - -GETH_BUILD=${GETH_BUILD:-"1.11.2-73b01f40"} - -BIN_DIR=${BIN_DIR:-"$HOME/bin"} - -PLATFORM="$(uname -s | awk '{print tolower($0)}')" -if [ "$PLATFORM" != "linux" ] && [ "$PLATFORM" != "darwin" ]; then - EXT=".exe" -fi - -main() { - mkdir -p "$BIN_DIR" - cd "$BIN_DIR" - export PATH="$BIN_DIR:$PATH" - if [ "$GITHUB_PATH" ]; then - echo "$BIN_DIR" >> "$GITHUB_PATH" - fi - - install_geth - - echo "" - echo "Installed Geth:" - geth version -} - -# Installs geth from https://geth.ethereum.org/downloads -install_geth() { - case "$PLATFORM" in - linux|darwin) - name="geth-$PLATFORM-amd64-$GETH_BUILD" - curl -s "https://gethstore.blob.core.windows.net/builds/$name.tar.gz" | tar -xzf - - mv -f "$name/geth" ./ - rm -rf "$name" - chmod +x geth - ;; - *) - name="geth-windows-amd64-$GETH_BUILD" - zip="$name.zip" - curl -so "$zip" "https://gethstore.blob.core.windows.net/builds/$zip" - unzip "$zip" - mv -f "$name/geth.exe" ./ - rm -rf "$name" "$zip" - ;; - esac -} - -main diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9834e8..1c68f92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,8 @@ name: CI +permissions: + contents: read + on: push: branches: [main] @@ -27,20 +30,12 @@ jobs: - rust: "1.88" # MSRV flags: "--all-features" steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - name: Install Anvil - uses: foundry-rs/foundry-toolchain@v1 + - uses: actions/checkout@v5 with: - version: nightly - - name: Install test binaries - shell: bash - run: ./.github/scripts/install_test_binaries.sh - - uses: Swatinem/rust-cache@v2 + persist-credentials: false + - uses: dtolnay/rust-toolchain@stable with: - cache-on-failure: true + toolchain: ${{ matrix.rust }} # Only run tests on latest stable and above - name: Install cargo-nextest if: ${{ matrix.rust != '1.88' }} # MSRV @@ -56,7 +51,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 + with: + persist-credentials: false - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: @@ -64,26 +61,13 @@ jobs: - run: cargo test --workspace --doc - run: cargo test --all-features --workspace --doc - no-std: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: riscv32imac-unknown-none-elf - - uses: taiki-e/install-action@cargo-hack - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - name: check - run: ./scripts/check_no_std.sh - feature-checks: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 + with: + persist-credentials: false - uses: dtolnay/rust-toolchain@stable - uses: taiki-e/install-action@cargo-hack - uses: Swatinem/rust-cache@v2 @@ -96,15 +80,14 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master + - uses: actions/checkout@v5 with: - toolchain: stable - components: clippy + persist-credentials: false + - uses: dtolnay/rust-toolchain@clippy - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - - run: cargo +stable clippy --workspace --all-targets --all-features + - run: cargo clippy --workspace --all-targets --all-features env: RUSTFLAGS: -Dwarnings @@ -112,7 +95,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 + with: + persist-credentials: false - uses: dtolnay/rust-toolchain@nightly - uses: Swatinem/rust-cache@v2 with: @@ -125,7 +110,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 + with: + persist-credentials: false - uses: dtolnay/rust-toolchain@nightly with: components: rustfmt @@ -137,10 +124,10 @@ jobs: ci-success: runs-on: ubuntu-latest if: always() + permissions: {} needs: - test - doctest - - no-std - feature-checks - clippy - docs diff --git a/scripts/check_no_std.sh b/scripts/check_no_std.sh deleted file mode 100755 index eb5f1fa..0000000 --- a/scripts/check_no_std.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail - -no_std_packages=( -) - -for package in "${no_std_packages[@]}"; do - cmd="cargo +stable build -p $package --target riscv32imac-unknown-none-elf --no-default-features" - if [ -n "$CI" ]; then - echo "::group::$cmd" - else - printf "\n%s:\n %s\n" "$package" "$cmd" - fi - - $cmd - - if [ -n "$CI" ]; then - echo "::endgroup::" - fi -done