From ffebd791b4c118988d196eadaac2297a42f55201 Mon Sep 17 00:00:00 2001 From: Saulius Grigaitis Date: Tue, 19 Mar 2024 15:52:43 +0200 Subject: [PATCH] Adding tests to Github CI #20 --- .github/workflows/ci.yml | 11 ++++++++--- scripts/ci/github.sh | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100755 scripts/ci/github.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8d8a040..b3482468 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install packages run: sudo scripts/ci/install.sh - - name: Build - run: scripts/ci/ci.sh + - name: Install Rust + run: rustup toolchain install stable --profile minimal + - name: Submodules + run: git submodule update --init + - 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 00000000..31edbb96 --- /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