Skip to content

Commit

Permalink
Adding tests to Github CI #20
Browse files Browse the repository at this point in the history
  • Loading branch information
sauliusgrigaitis committed Mar 21, 2024
1 parent 6fe2be2 commit 4076070
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@ 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:
path: .git
submodules: true
- name: Install Rust
run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo test --release
41 changes: 41 additions & 0 deletions scripts/ci/github.sh
Original file line number Diff line number Diff line change
@@ -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:
# <https://github.com/rust-lang/rustfmt/issues/3647>
# Running `cargo-fmt` with `--all` works too but takes noticeably longer. This explains why:
# <https://github.com/rust-lang/rustfmt/issues/4247#issuecomment-644957261>
(
cd ../..
cargo fmt -- --check
)

./clippy.bash --deny warnings
cargo test --release --no-fail-fast
./consensus-spec-tests-coverage.rb

0 comments on commit 4076070

Please sign in to comment.