diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 0b29751106..b19fc1e0b0 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -21,6 +21,18 @@ jobs: steps: - name: Check that the pull request is not targeting the stable branch run: test ${{ github.base_ref }} != "stable" + extract-msrv: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Extract Minimum Supported Rust Version (MSRV) + run: | + metadata=$(cargo metadata --no-deps --format-version 1) + msrv=$(echo $metadata | jq -r '.packages | map(select(.name == "lighthouse")) | .[0].rust_version') + echo "::set-output name=MSRV::$msrv" + id: extract_msrv + outputs: + MSRV: ${{ steps.extract_msrv.outputs.MSRV }} cargo-fmt: name: cargo-fmt runs-on: ubuntu-latest @@ -229,6 +241,16 @@ jobs: run: make lint - name: Certify Cargo.lock freshness run: git diff --exit-code Cargo.lock + check-msrv: + name: check-msrv + runs-on: ubuntu-latest + needs: [cargo-fmt, extract-msrv] + steps: + - uses: actions/checkout@v1 + - name: Install Rust @ MSRV (${{ needs.extract-msrv.outputs.MSRV }}) + run: rustup override set ${{ needs.extract-msrv.outputs.MSRV }} + - name: Run cargo check + run: cargo check --workspace arbitrary-check: name: arbitrary-check runs-on: ubuntu-latest diff --git a/bors.toml b/bors.toml index f63901ef4b..d7d1e98762 100644 --- a/bors.toml +++ b/bors.toml @@ -18,7 +18,8 @@ status = [ "op-pool-tests", "doppelganger-protection-test", "execution-engine-integration-ubuntu", - "cargo-vendor" + "cargo-vendor", + "check-msrv" ] use_squash_merge = true timeout_sec = 10800 diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index 7c9809403d..932ef9ae62 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -4,6 +4,7 @@ version = "2.1.4" authors = ["Sigma Prime "] edition = "2021" autotests = false +rust-version = "1.58" [features] # Writes debugging .ssz files to /tmp during block processing.