From 5cf5f0a9127cf0d62067e3cbc1fe022ce8e22df9 Mon Sep 17 00:00:00 2001 From: Ted Driggs Date: Wed, 26 Oct 2022 13:20:27 -0700 Subject: [PATCH] Split trybuild tests out to own job --- .github/workflows/build.yml | 1 - .github/workflows/compiletests.yml | 26 ++++++++++++++++++++++++++ derive_builder/Cargo.toml | 4 +++- derive_builder/tests/compiletests.rs | 2 ++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/compiletests.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a9d4343..6cd7a77c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,6 @@ jobs: - beta - stable - 1.40.0 # MSRV - - 1.59.0 # Used for trybuild; supports aarch64 features: - "" - --no-default-features diff --git a/.github/workflows/compiletests.yml b/.github/workflows/compiletests.yml new file mode 100644 index 00000000..ee986533 --- /dev/null +++ b/.github/workflows/compiletests.yml @@ -0,0 +1,26 @@ +name: Compile Test + +on: [push, pull_request] + +jobs: + compiletest: + runs-on: ubuntu-latest + + env: + RUST_BACKTRACE: 1 + RUSTFLAGS: "--cfg compiletests" + + steps: + - uses: actions/checkout@v2 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.59.0 + override: true + + - name: main crate + run: | + cd derive_builder + cargo build --verbose + cargo test --no-fail-fast --verbose -- --nocapture + cargo doc diff --git a/derive_builder/Cargo.toml b/derive_builder/Cargo.toml index d88cb4ef..f7f81371 100644 --- a/derive_builder/Cargo.toml +++ b/derive_builder/Cargo.toml @@ -26,6 +26,8 @@ derive_builder_macro = { version = "=0.11.2", path = "../derive_builder_macro" } [dev-dependencies] pretty_assertions = "0.6.1" rustversion = "1.0.4" -trybuild = "1.0.38" serde = { version = "1", features = ["derive"] } serde_json = "1" + +[target.'cfg(compiletests)'.dev-dependencies] +trybuild = "1.0.38" \ No newline at end of file diff --git a/derive_builder/tests/compiletests.rs b/derive_builder/tests/compiletests.rs index 4ab9e4ad..5c43973c 100644 --- a/derive_builder/tests/compiletests.rs +++ b/derive_builder/tests/compiletests.rs @@ -1,3 +1,5 @@ +#![cfg(compiletests)] + extern crate rustversion; extern crate trybuild;