From 7d545b55afda014b8d290053ed8d507eb1f0c480 Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Mon, 15 Aug 2022 16:01:07 -0700 Subject: [PATCH] Update testing commands --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++-- rust-toolchain.toml | 2 ++ test-full.bash | 13 +++++++------ test.bash | 4 +++- 4 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dcbc77..c9f83cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,16 +54,41 @@ jobs: override: true components: rustfmt - - name: Run Cargo check + - name: Run `cargo +stable check --all-targets` uses: actions-rs/cargo@v1 with: + toolchain: stable command: check args: --all-targets - - name: Run Cargo test + - name: Run `cargo +stable check --all-targets --features tracing` + uses: actions-rs/cargo@v1 + with: + toolchain: stable + command: check + args: --all-targets --features tracing + + - name: Run `cargo check --all-targets --features nightly,tracing` + uses: actions-rs/cargo@v1 + with: + command: check + args: --all-targets --features nightly,tracing + + - name: Run `cargo build --all-targets --features nightly,deny-unknown` + uses: actions-rs/cargo@v1 + with: + command: build + args: --all-targets --features nightly,deny-unknown + + - name: Run `cargo test --features nightly,deny-unknown` uses: actions-rs/cargo@v1 with: command: test + args: --features nightly,deny-unknown + env: + RUST_BACKTRACE: 1 + RUSTLOG: riven=trace + RGAPI_KEY: ${{ secrets.RGAPI_KEY }} # lints: # name: Lints diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..5d56faf --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly" diff --git a/test-full.bash b/test-full.bash index c1a6519..0fdd539 100755 --- a/test-full.bash +++ b/test-full.bash @@ -1,12 +1,13 @@ #!/bin/bash -set -e +set -euxo pipefail # Ensure stable builds. -cargo +stable test --no-run -cargo +stable test --no-run --features tracing +cargo +stable check --all-targets +cargo +stable check --all-targets --features tracing # Ensure nightly builds. -cargo +nightly test --no-run --features nightly,tracing +cargo check --all-targets --features nightly,tracing +cargo build --all-targets --features nightly,deny-unknown -# Run tests on nightly. -RGAPI_KEY="$(cat apikey.txt)" RUST_BACKTRACE=1 RUST_LOG=riven=trace cargo +nightly test --features nightly,deny-unknown -- --nocapture +# Run nightly tests. +bash test.bash diff --git a/test.bash b/test.bash index 126fa8c..47ccf63 100755 --- a/test.bash +++ b/test.bash @@ -1,2 +1,4 @@ #!/bin/bash -RGAPI_KEY="$(cat apikey.txt)" RUST_BACKTRACE=1 RUST_LOG=riven=trace cargo +nightly test --features nightly,deny-unknown-fields $1 -- --nocapture +set -euxo pipefail + +RGAPI_KEY="$(cat apikey.txt)" RUST_BACKTRACE=1 RUST_LOG=riven=trace cargo test --features nightly,deny-unknown -- --nocapture