diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 007070dbb5b..92c9b89d5bf 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -78,9 +78,11 @@ jobs: - name: Dockerhub login run: | echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin + - uses: cargo-bins/cargo-binstall@main + - name: Install cross + run: cargo binstall --no-confirm cross - name: Cross build Lighthouse binary run: | - cargo install cross env CROSS_PROFILE=${{ matrix.profile }} CROSS_FEATURES=${{ matrix.features.env }} make build-${{ matrix.binary }} - name: Make bin dir run: mkdir ./bin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 24ca09ec00e..60d183e0ade 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,6 +72,9 @@ jobs: - name: Get latest version of stable Rust if: env.SELF_HOSTED_RUNNERS == 'false' run: rustup update stable + - uses: cargo-bins/cargo-binstall@main + - name: Install cross + run: cargo binstall --no-confirm cross # ============================== # Windows dependencies @@ -93,25 +96,21 @@ jobs: - name: Build Lighthouse for aarch64-unknown-linux-gnu-portable if: matrix.arch == 'aarch64-unknown-linux-gnu-portable' run: | - cargo install cross env CROSS_PROFILE=${{ matrix.profile }} make build-aarch64-portable - name: Build Lighthouse for aarch64-unknown-linux-gnu if: matrix.arch == 'aarch64-unknown-linux-gnu' run: | - cargo install cross env CROSS_PROFILE=${{ matrix.profile }} make build-aarch64 - name: Build Lighthouse for x86_64-unknown-linux-gnu-portable if: matrix.arch == 'x86_64-unknown-linux-gnu-portable' run: | - cargo install cross env CROSS_PROFILE=${{ matrix.profile }} make build-x86_64-portable - name: Build Lighthouse for x86_64-unknown-linux-gnu if: matrix.arch == 'x86_64-unknown-linux-gnu' run: | - cargo install cross env CROSS_PROFILE=${{ matrix.profile }} make build-x86_64 - name: Move cross-compiled binary diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index fd9b77ae2f9..72e94de3dac 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -69,6 +69,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + - uses: Swatinem/rust-cache@v2 - name: Run tests in release run: make test-release release-tests-windows: @@ -93,6 +94,7 @@ jobs: directory: ${{ runner.temp }}/llvm - name: Set LIBCLANG_PATH run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV + - uses: Swatinem/rust-cache@v2 - name: Run tests in release run: make test-release beacon-chain-tests: @@ -105,6 +107,7 @@ jobs: - name: Get latest version of stable Rust if: env.SELF_HOSTED_RUNNERS == false run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run beacon_chain tests for all known forks run: make test-beacon-chain op-pool-tests: @@ -115,6 +118,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run operation_pool tests for all known forks run: make test-op-pool slasher-tests: @@ -125,6 +129,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run slasher tests for all supported backends run: make test-slasher debug-tests-ubuntu: @@ -141,6 +146,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + - uses: Swatinem/rust-cache@v2 - name: Run tests in debug run: make test-debug state-transition-vectors-ubuntu: @@ -151,6 +157,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run state_transition_vectors in release. run: make run-state-transition-tests ef-tests-ubuntu: @@ -163,6 +170,7 @@ jobs: - name: Get latest version of stable Rust if: env.SELF_HOSTED_RUNNERS == false run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run consensus-spec-tests with blst, milagro and fake_crypto run: make test-ef dockerfile-ubuntu: @@ -189,6 +197,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + - uses: Swatinem/rust-cache@v2 - name: Run the beacon chain sim that starts from an eth1 contract run: cargo run --release --bin simulator eth1-sim merge-transition-ubuntu: @@ -203,6 +212,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + - uses: Swatinem/rust-cache@v2 - name: Run the beacon chain sim and go through the merge transition run: cargo run --release --bin simulator eth1-sim --post-merge no-eth1-simulator-ubuntu: @@ -213,6 +223,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run the beacon chain sim without an eth1 connection run: cargo run --release --bin simulator no-eth1-sim syncing-simulator-ubuntu: @@ -227,6 +238,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + - uses: Swatinem/rust-cache@v2 - name: Run the syncing simulator run: cargo run --release --bin simulator syncing-sim doppelganger-protection-test: @@ -237,6 +249,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Install geth run: | sudo add-apt-repository -y ppa:ethereum/ethereum @@ -268,6 +281,7 @@ jobs: dotnet-version: '6.0.201' - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run exec engine integration tests in release run: make test-exec-engine check-benchmarks: @@ -278,6 +292,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Typecheck benchmark code without running it run: make check-benches clippy: @@ -288,6 +303,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Lint code for quality and style with Clippy run: make lint - name: Certify Cargo.lock freshness @@ -300,6 +316,7 @@ jobs: - uses: actions/checkout@v3 - name: Install Rust @ MSRV (${{ needs.extract-msrv.outputs.MSRV }}) run: rustup override set ${{ needs.extract-msrv.outputs.MSRV }} + - uses: Swatinem/rust-cache@v2 - name: Run cargo check run: cargo check --workspace arbitrary-check: @@ -310,6 +327,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Validate state_processing feature arbitrary-fuzz run: make arbitrary-fuzz cargo-audit: @@ -320,6 +338,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run cargo audit to identify known security vulnerabilities reported to the RustSec Advisory Database run: make audit cargo-vendor: @@ -338,8 +357,10 @@ jobs: - uses: actions/checkout@v3 - name: Install Rust (${{ env.PINNED_NIGHTLY }}) run: rustup toolchain install $PINNED_NIGHTLY + - uses: Swatinem/rust-cache@v2 + - uses: cargo-bins/cargo-binstall@main - name: Install cargo-udeps - run: cargo install cargo-udeps --locked --force + run: cargo binstall --no-confirm cargo-udeps --locked --force - name: Create Cargo config dir run: mkdir -p .cargo - name: Install custom Cargo config @@ -358,5 +379,6 @@ jobs: run: sudo apt install -y git gcc g++ make cmake pkg-config llvm-dev libclang-dev clang - name: Use Rust beta run: rustup override set beta + - uses: Swatinem/rust-cache@v2 - name: Run make run: make