-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add custom
cfg
for expand test (#323)
- Loading branch information
Showing
4 changed files
with
9 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,22 +12,8 @@ jobs: | |
runs-on: ubuntu-24.04-arm | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- run: cargo install --locked cargo-expand | ||
- uses: dtolnay/[email protected] | ||
id: rust-toolchain | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}- | ||
${{ runner.os }}-cargo- | ||
- run: cargo check --workspace --all-targets --no-default-features | ||
- run: cargo check --workspace --all-targets --all-features | ||
- run: cargo test --workspace --all-features --lib --bins --examples --tests -- --skip expand | ||
|
@@ -39,24 +25,10 @@ jobs: | |
runs-on: ubuntu-24.04-arm | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- run: cargo install --locked cargo-expand | ||
- uses: dtolnay/rust-toolchain@stable | ||
id: rust-toolchain | ||
with: | ||
components: clippy, rustfmt | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}- | ||
${{ runner.os }}-cargo- | ||
- name: Check | ||
run: cargo check --workspace --all-targets --all-features | ||
- name: Test | ||
|
@@ -75,19 +47,6 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@miri | ||
id: rust-toolchain | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-miri-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-miri- | ||
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}- | ||
${{ runner.os }}-cargo- | ||
- run: cargo miri setup | ||
- run: cargo miri test --no-default-features | ||
- run: cargo miri test --all-features | ||
|
@@ -100,25 +59,10 @@ jobs: | |
RUSTDOCFLAGS: "-C instrument-coverage" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- run: cargo install --locked cargo-expand | ||
- uses: dtolnay/rust-toolchain@stable | ||
id: rust-toolchain | ||
with: | ||
components: llvm-tools-preview | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-coverage-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-coverage- | ||
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}- | ||
${{ runner.os }}-cargo- | ||
- run: cargo build --workspace --all-targets --all-features | ||
- run: cargo test --workspace --all-targets --all-features | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
#[test] | ||
#[cfg(narrow_macrotest)] | ||
/// To run these tests: | ||
/// `RUSTFLAGS='--cfg narrow_macrotest' cargo test -p narrow-derive expand` | ||
/// | ||
/// To update the generated output: | ||
/// `MACROTEST=overwrite RUSTFLAGS='--cfg narrow_macrotest' cargo test -p narrow-derive expand` | ||
fn expand() { | ||
macrotest::expand("tests/expand/**/*.rs"); | ||
} |