From 1781bce5fd49eaafc832e88c66c540f6ff73996b Mon Sep 17 00:00:00 2001 From: howardwu Date: Fri, 26 Jun 2020 18:43:29 -0700 Subject: [PATCH] Adds ci.yml --- .github/workflows/ci.yml | 144 +++++++++++++++++++++++++++++++++++++++ Cargo.lock | 4 +- 2 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..e13e81ce17 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,144 @@ +name: CI +on: + pull_request: + push: + branches: + - master +env: + RUST_BACKTRACE: 1 + +jobs: + style: + name: Check Style + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v1 + + - name: Fetch snarkOS + run: | + mkdir ~/.ssh + echo "${{ secrets.SNARKOS_DEPLOY_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + eval $(ssh-agent -s) + ssh-add -k ~/.ssh/id_rsa + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: rustfmt + + - name: cargo fmt --check + uses: actions-rs/cargo@v1 + env: + CARGO_NET_GIT_FETCH_WITH_CLI: true + with: + command: fmt + args: --all -- --check + + test: + name: Test + runs-on: ubuntu-latest + env: + RUSTFLAGS: -Dwarnings + strategy: + matrix: + rust: + - stable + - nightly + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Fetch snarkOS + run: | + mkdir ~/.ssh + echo "${{ secrets.SNARKOS_DEPLOY_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + eval $(ssh-agent -s) + ssh-add -k ~/.ssh/id_rsa + + - name: Install Rust (${{ matrix.rust }}) + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + + - name: Check examples + uses: actions-rs/cargo@v1 + env: + CARGO_NET_GIT_FETCH_WITH_CLI: true + with: + command: check + args: --examples --all + + - name: Check examples with all features on stable + uses: actions-rs/cargo@v1 + env: + CARGO_NET_GIT_FETCH_WITH_CLI: true + with: + command: check + args: --examples --all-features --all + if: matrix.rust == 'stable' + + - name: Check benchmarks on nightly + uses: actions-rs/cargo@v1 + env: + CARGO_NET_GIT_FETCH_WITH_CLI: true + with: + command: check + args: --all-features --examples --all --benches + if: matrix.rust == 'nightly' + + - name: Test + uses: actions-rs/cargo@v1 + env: + CARGO_NET_GIT_FETCH_WITH_CLI: true + with: + command: test + args: --release + +# check_no_std: +# name: Check no_std +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# +# - name: Fetch snarkOS +# run: | +# mkdir ~/.ssh +# echo "${{ secrets.SNARKOS_DEPLOY_KEY }}" > ~/.ssh/id_rsa +# chmod 600 ~/.ssh/id_rsa +# eval $(ssh-agent -s) +# ssh-add -k ~/.ssh/id_rsa +# +# - name: Install Rust (${{ matrix.rust }}) +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# target: thumbv6m-none-eabi +# override: true +# +# - name: Build +# uses: actions-rs/cargo@v1 +# env: +# CARGO_NET_GIT_FETCH_WITH_CLI: true +# with: +# use-cross: true +# command: build +# args: --no-default-features --target thumbv6m-none-eabi +# +# - name: Check +# uses: actions-rs/cargo@v1 +# env: +# CARGO_NET_GIT_FETCH_WITH_CLI: true +# with: +# use-cross: true +# command: check +# args: --examples --no-default-features --target thumbv6m-none-eabi diff --git a/Cargo.lock b/Cargo.lock index 3fccd5be74..0625bc061e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,9 +78,9 @@ checksum = "58946044516aa9dc922182e0d6e9d124a31aafe6b421614654eb27cf90cec09c" [[package]] name = "bincode" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" +checksum = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" dependencies = [ "byteorder", "serde",