Skip to content

Commit 48eb177

Browse files
daxpeddaModProg
authored andcommitted
Test minimal versions
Move testing crates into `test-crates`
1 parent 3d1ec23 commit 48eb177

File tree

10 files changed

+68
-6
lines changed

10 files changed

+68
-6
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,35 @@ jobs:
9292
- name: Build
9393
run:
9494
cargo build --target thumbv6m-none-eabi ${{ matrix.features }} -p ensure-no-std
95+
96+
minimal-versions:
97+
name: Minimal Versions
98+
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
rust:
103+
- version: 1.57.0
104+
features: safe,zeroize-on-drop
105+
- version: stable
106+
features: safe,zeroize-on-drop
107+
- version: nightly
108+
features: nightly,safe,zeroize-on-drop
109+
110+
runs-on: ubuntu-latest
111+
112+
steps:
113+
- name: Update Rust
114+
run: |
115+
rustup toolchain install ${{ matrix.rust.version }} --profile minimal --allow-downgrade
116+
rustup default ${{ matrix.rust.version }}
117+
- name: Install nightly Rust
118+
run:
119+
rustup toolchain install nightly --profile minimal --allow-downgrade
120+
- name: Checkout
121+
uses: actions/checkout@v3
122+
- name: Build
123+
working-directory: test-crates/minimal-versions
124+
run: |
125+
cargo +nightly update -Z minimal-versions
126+
cargo build --features ${{ matrix.rust.features }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/target
2-
Cargo.lock
2+
/Cargo.lock

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
default-members = [""]
3-
members = ["", "crate_", "ensure-no-std"]
3+
members = ["", "test-crates/crate_", "test-crates/ensure-no-std"]
44
resolver = "2"
55

66
[package]
@@ -29,7 +29,7 @@ zeroize-on-drop = ["zeroize"]
2929
[dependencies]
3030
proc-macro2 = { version = "1", default-features = false, features = ["proc-macro"] }
3131
quote = { version = "1", default-features = false }
32-
syn = { version = "1", default-features = false, features = [
32+
syn = { version = "1.0.56", default-features = false, features = [
3333
"clone-impls",
3434
"derive",
3535
"extra-traits",
@@ -39,7 +39,7 @@ syn = { version = "1", default-features = false, features = [
3939
] }
4040

4141
[dev-dependencies]
42-
trybuild = { version = "1", default-features = false }
42+
trybuild = { version = "1.0.18", default-features = false }
4343
zeroize_ = { version = "1.5", package = "zeroize", default-features = false }
4444

4545
[[test]]

crate_/Cargo.toml renamed to test-crates/crate_/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ zeroize = ["derive-where_/zeroize", "zeroize_"]
1111
zeroize-on-drop = ["derive-where_/zeroize-on-drop", "zeroize"]
1212

1313
[dependencies]
14-
derive-where_ = { path = "..", package = "derive-where" }
14+
derive-where_ = { path = "../..", package = "derive-where" }
1515
zeroize_ = { version = "1.5", package = "zeroize", default-features = false, optional = true }
1616

1717
[lib]
File renamed without changes.

ensure-no-std/Cargo.toml renamed to test-crates/ensure-no-std/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ zeroize = ["derive-where/zeroize", "zeroize_"]
1111
zeroize-on-drop = ["derive-where/zeroize-on-drop", "zeroize"]
1212

1313
[dependencies]
14-
derive-where = { path = ".." }
14+
derive-where = { path = "../.." }
1515
zeroize_ = { version = "1.5", package = "zeroize", default-features = false, optional = true }
1616

1717
[lib]
File renamed without changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
/Cargo.lock
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[workspace]
2+
resolver = "2"
3+
4+
[package]
5+
edition = "2021"
6+
name = "minimal-versions"
7+
publish = false
8+
version = "0.0.0"
9+
10+
[features]
11+
nightly = ["derive-where/nightly"]
12+
safe = ["derive-where/safe"]
13+
zeroize = ["derive-where/zeroize", "zeroize_"]
14+
zeroize-on-drop = ["derive-where/zeroize-on-drop", "zeroize"]
15+
16+
[dependencies]
17+
derive-where = { path = "../.." }
18+
zeroize_ = { version = "1.5", package = "zeroize", default-features = false, optional = true }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[cfg(feature = "zeroize")]
2+
extern crate zeroize_ as zeroize;
3+
4+
use core::marker::PhantomData;
5+
6+
use derive_where::derive_where;
7+
8+
#[derive_where(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
9+
#[cfg_attr(feature = "zeroize", derive_where(Zeroize))]
10+
pub struct Test<T>(PhantomData<T>);

0 commit comments

Comments
 (0)