diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8d8a04..4302ebb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,16 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Install packages - run: sudo scripts/ci/install.sh - - name: Build - run: scripts/ci/ci.sh + - name: Cache repository + uses: actions/cache@v4 + with: + path: .git + key: repository-dir + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install Rust + run: rustup toolchain install stable --profile minimal + - uses: Swatinem/rust-cache@v2 + - name: Test + run: cargo test --release diff --git a/scripts/ci/github.sh b/scripts/ci/github.sh new file mode 100755 index 0000000..31edbb9 --- /dev/null +++ b/scripts/ci/github.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +set -o errexit +set -o nounset + +cd "$(dirname "$0")" + +export PATH="${CARGO_HOME:-$HOME/.cargo}/bin:$PATH" + +git submodule update --init \ + ../../consensus-spec-tests \ + ../../eth2_libp2p \ + ../../grandine-snapshot-tests \ + ../../slashing-protection-interchange-tests +( + cd ../../consensus-spec-tests + git lfs pull +) + +#curl \ +# --fail \ +# --proto =https \ +# --show-error \ +# --silent \ +# --tlsv1.2 \ +# https://sh.rustup.rs | +# sponge | +# sh -s -- --no-modify-path -y + +# `cargo-fmt` must be run in the root of a crate. It appears to be a regression: +# +# Running `cargo-fmt` with `--all` works too but takes noticeably longer. This explains why: +# +( + cd ../.. + cargo fmt -- --check +) + +./clippy.bash --deny warnings +cargo test --release --no-fail-fast +./consensus-spec-tests-coverage.rb