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 19, 2024
1 parent 6fe2be2 commit 3c21744
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install packages
run: sudo scripts/ci/install.sh
- name: Install Rust
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: Build
run: scripts/ci/ci.sh
run: scripts/ci/github.sh
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 3c21744

Please sign in to comment.