From e7221306b58cedc93287365bcf9727efd8eb53c4 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 | 18 +++++++++++++----- scripts/ci/github.sh | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 5 deletions(-) create mode 100755 scripts/ci/github.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8d8a040..4302ebb6 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 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