From 6cc9b431406149e75b2161f115cca8ec71e57b84 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 | 2 +- scripts/ci/github.sh | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 scripts/ci/github.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8d8a040..69bdd8f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,4 +12,4 @@ jobs: - name: Install packages run: sudo scripts/ci/install.sh - name: Build - run: scripts/ci/ci.sh + run: scripts/ci/github.sh diff --git a/scripts/ci/github.sh b/scripts/ci/github.sh new file mode 100755 index 00000000..955ab426 --- /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