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 78ae220
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 tests::next_tick_with_instant_with_mainnet_config::_10_seconds_after_genesis
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 78ae220

Please sign in to comment.