2019-11-25 04:48:24 +00:00
|
|
|
name: test-suite
|
|
|
|
|
2020-05-19 03:17:49 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-02-11 06:06:54 +00:00
|
|
|
- stable
|
2020-07-07 06:31:20 +00:00
|
|
|
- staging
|
|
|
|
- trying
|
2020-07-09 09:23:28 +00:00
|
|
|
- 'pr/*'
|
2020-05-19 03:17:49 +00:00
|
|
|
pull_request:
|
2020-07-21 05:51:33 +00:00
|
|
|
env:
|
|
|
|
# Deny warnings in CI
|
|
|
|
RUSTFLAGS: "-D warnings"
|
2019-11-25 04:48:24 +00:00
|
|
|
jobs:
|
2021-02-09 02:00:53 +00:00
|
|
|
target-branch-check:
|
|
|
|
name: target-branch-check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
steps:
|
|
|
|
- name: Check that pull request is targeting unstable branch
|
|
|
|
run: test ${{ github.base_ref }} = "unstable"
|
2019-11-25 04:48:24 +00:00
|
|
|
cargo-fmt:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: cargo-fmt
|
2019-11-25 04:48:24 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2021-02-15 00:09:12 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2019-11-25 04:48:24 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
|
|
|
- name: Check formatting with cargo fmt
|
|
|
|
run: make cargo-fmt
|
|
|
|
release-tests-ubuntu:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: release-tests-ubuntu
|
2019-11-25 04:48:24 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2019-11-27 01:47:46 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2019-11-25 04:48:24 +00:00
|
|
|
- name: Install ganache-cli
|
|
|
|
run: sudo npm install -g ganache-cli
|
|
|
|
- name: Run tests in release
|
|
|
|
run: make test-release
|
|
|
|
debug-tests-ubuntu:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: debug-tests-ubuntu
|
2019-11-25 04:48:24 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2019-11-27 01:47:46 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2019-11-25 04:48:24 +00:00
|
|
|
- name: Install ganache-cli
|
|
|
|
run: sudo npm install -g ganache-cli
|
|
|
|
- name: Run tests in debug
|
|
|
|
run: make test-debug
|
2020-05-08 23:37:21 +00:00
|
|
|
state-transition-vectors-ubuntu:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: state-transition-vectors-ubuntu
|
2020-05-08 23:37:21 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
|
|
|
- name: Run state_transition_vectors in release.
|
|
|
|
run: make run-state-transition-tests
|
2019-11-25 04:48:24 +00:00
|
|
|
ef-tests-ubuntu:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: ef-tests-ubuntu
|
2019-11-25 04:48:24 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2019-11-27 01:47:46 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2020-07-25 02:03:18 +00:00
|
|
|
- name: Run eth2.0-spec-tests with blst, milagro and fake_crypto
|
2019-11-25 04:48:24 +00:00
|
|
|
run: make test-ef
|
|
|
|
dockerfile-ubuntu:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: dockerfile-ubuntu
|
2019-11-25 04:48:24 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2021-02-15 00:09:12 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2019-11-25 04:48:24 +00:00
|
|
|
- name: Build the root Dockerfile
|
|
|
|
run: docker build .
|
2020-05-26 08:30:44 +00:00
|
|
|
eth1-simulator-ubuntu:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: eth1-simulator-ubuntu
|
2020-05-26 08:30:44 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2021-02-15 00:09:12 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2020-05-26 08:30:44 +00:00
|
|
|
- name: Install ganache-cli
|
|
|
|
run: sudo npm install -g ganache-cli
|
|
|
|
- name: Run the beacon chain sim that starts from an eth1 contract
|
|
|
|
run: cargo run --release --bin simulator eth1-sim
|
2020-03-30 05:42:03 +00:00
|
|
|
no-eth1-simulator-ubuntu:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: no-eth1-simulator-ubuntu
|
2020-03-30 05:42:03 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2021-02-15 00:09:12 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2020-03-30 05:42:03 +00:00
|
|
|
- name: Install ganache-cli
|
|
|
|
run: sudo npm install -g ganache-cli
|
|
|
|
- name: Run the beacon chain sim without an eth1 connection
|
|
|
|
run: cargo run --release --bin simulator no-eth1-sim
|
2020-12-16 05:37:38 +00:00
|
|
|
syncing-simulator-ubuntu:
|
|
|
|
name: syncing-simulator-ubuntu
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2021-02-15 00:09:12 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2020-12-16 05:37:38 +00:00
|
|
|
- name: Install ganache-cli
|
|
|
|
run: sudo npm install -g ganache-cli
|
|
|
|
- name: Run the syncing simulator
|
|
|
|
run: cargo run --release --bin simulator syncing-sim
|
2020-04-06 10:16:08 +00:00
|
|
|
check-benchmarks:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: check-benchmarks
|
2020-04-06 10:16:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2021-02-15 00:09:12 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2020-04-06 10:16:08 +00:00
|
|
|
- name: Typecheck benchmark code without running it
|
|
|
|
run: make check-benches
|
Remove saturating arith from state_processing (#1644)
## Issue Addressed
Resolves #1100
## Proposed Changes
* Implement the `SafeArith` trait for `Slot` and `Epoch`, so that methods like `safe_add` become available.
* Tweak the `SafeArith` trait to allow a different `Rhs` type (analagous to `std::ops::Add`, etc).
* Add a `legacy-arith` feature to `types` and `state_processing` that conditionally enables implementations of
the `std` ops with saturating semantics.
* Check compilation of `types` and `state_processing` _without_ `legacy-arith` on CI,
thus guaranteeing that they only use the `SafeArith` primitives :tada:
## Additional Info
The `legacy-arith` feature gets turned on by all higher-level crates that depend on `state_processing` or `types`, thus allowing the beacon chain, networking, and other components to continue to rely on the availability of ops like `+`, `-`, `*`, etc.
**This is a consensus-breaking change**, but brings us in line with the spec, and our incompatibilities shouldn't have been reachable with any valid configuration of Eth2 parameters.
2020-09-25 05:18:21 +00:00
|
|
|
check-consensus:
|
|
|
|
name: check-consensus
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2021-02-15 00:09:12 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
Remove saturating arith from state_processing (#1644)
## Issue Addressed
Resolves #1100
## Proposed Changes
* Implement the `SafeArith` trait for `Slot` and `Epoch`, so that methods like `safe_add` become available.
* Tweak the `SafeArith` trait to allow a different `Rhs` type (analagous to `std::ops::Add`, etc).
* Add a `legacy-arith` feature to `types` and `state_processing` that conditionally enables implementations of
the `std` ops with saturating semantics.
* Check compilation of `types` and `state_processing` _without_ `legacy-arith` on CI,
thus guaranteeing that they only use the `SafeArith` primitives :tada:
## Additional Info
The `legacy-arith` feature gets turned on by all higher-level crates that depend on `state_processing` or `types`, thus allowing the beacon chain, networking, and other components to continue to rely on the availability of ops like `+`, `-`, `*`, etc.
**This is a consensus-breaking change**, but brings us in line with the spec, and our incompatibilities shouldn't have been reachable with any valid configuration of Eth2 parameters.
2020-09-25 05:18:21 +00:00
|
|
|
- name: Typecheck consensus code in strict mode
|
|
|
|
run: make check-consensus
|
2020-04-20 02:35:11 +00:00
|
|
|
clippy:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: clippy
|
2020-04-20 02:35:11 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2021-02-15 00:09:12 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2020-04-20 02:35:11 +00:00
|
|
|
- name: Lint code for quality and style with Clippy
|
|
|
|
run: make lint
|
2020-08-26 00:01:08 +00:00
|
|
|
- name: Certify Cargo.lock freshness
|
|
|
|
run: git diff --exit-code Cargo.lock
|
2020-05-05 23:12:28 +00:00
|
|
|
arbitrary-check:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: arbitrary-check
|
2020-07-07 06:31:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2021-02-15 00:09:12 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2020-07-07 06:31:20 +00:00
|
|
|
- name: Validate state_processing feature arbitrary-fuzz
|
|
|
|
run: make arbitrary-fuzz
|
2020-05-26 07:04:39 +00:00
|
|
|
cargo-audit:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: cargo-audit
|
2020-07-07 06:31:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2021-02-15 00:09:12 +00:00
|
|
|
- name: Get latest version of stable Rust
|
|
|
|
run: rustup update stable
|
2020-07-07 06:31:20 +00:00
|
|
|
- name: Run cargo audit to identify known security vulnerabilities reported to the RustSec Advisory Database
|
|
|
|
run: make audit
|
2020-06-14 00:59:50 +00:00
|
|
|
cargo-udeps:
|
2020-07-07 13:44:35 +00:00
|
|
|
name: cargo-udeps
|
2020-07-07 06:31:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: cargo-fmt
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2020-07-22 07:34:30 +00:00
|
|
|
- name: Install a nightly compiler with rustfmt, as a kind of quality control
|
|
|
|
run: rustup toolchain install --component=rustfmt nightly
|
2020-07-07 06:31:20 +00:00
|
|
|
- name: Install cargo-udeps
|
|
|
|
run: cargo install cargo-udeps --locked
|
|
|
|
- name: Run cargo udeps to identify unused crates in the dependency graph
|
|
|
|
run: make udeps
|
2020-07-21 05:51:33 +00:00
|
|
|
env:
|
|
|
|
# Allow warnings on Nightly
|
|
|
|
RUSTFLAGS: ""
|