From 04c9a3a4dc470a52f4dd42ed1efd2b0fcfdea42d Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Tue, 20 Feb 2024 09:21:34 -0600 Subject: [PATCH 1/6] ci: add format, clippy, and test jobs --- .github/workflows/ci.yaml | 57 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..96da442 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,57 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + format: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Rust Toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: Rust Format Check + run: cargo fmt --verbose --check --all + + clippy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Rust Toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - name: Clippy Checks + run: cargo clippy --verbose --workspace --tests -- -D warnings + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Rust Toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Build + run: cargo build --verbose --workspace + + - name: Tests + run: cargo test --verbose --workspace + + - name: Ignored (Slow) Tests + run: cargo test --verbose --workspace -- --ignored From 23ea55918d0d37a4b75d47e6b8012b5ef552f3a8 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Tue, 20 Feb 2024 10:42:46 -0600 Subject: [PATCH 2/6] chore: set msrv to 1.70 --- Cargo.toml | 2 ++ compose_spec_macros/Cargo.toml | 1 + 2 files changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 41ec676..908457a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ edition = "2021" license = "MPL-2.0" readme = "README.md" repository = "https://github.com/k9withabone/compose_spec_rs" +rust-version = "1.70" [workspace.lints.clippy] pedantic = "warn" @@ -25,6 +26,7 @@ edition.workspace = true license.workspace = true readme.workspace = true repository.workspace = true +rust-version.workspace = true description = "Types for (de)serializing from/to the compose-spec" keywords = ["compose", "containers", "docker", "podman"] categories = ["api-bindings"] diff --git a/compose_spec_macros/Cargo.toml b/compose_spec_macros/Cargo.toml index 88d11f0..315f11f 100644 --- a/compose_spec_macros/Cargo.toml +++ b/compose_spec_macros/Cargo.toml @@ -6,6 +6,7 @@ edition.workspace = true license.workspace = true readme.workspace = true repository.workspace = true +rust-version.workspace = true description = "Procedural macros for use in the compose_spec crate" [lib] From 84d145a387ab73e0c214c4fef58e7573c97cdf24 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Tue, 20 Feb 2024 14:13:21 -0600 Subject: [PATCH 3/6] chore(deps): set minimal version requirements --- Cargo.toml | 10 +++++----- compose_spec_macros/Cargo.toml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 908457a..ac85014 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ pedantic = "warn" [workspace.dependencies] compose_spec_macros = { version = "=0.1.0", path = "compose_spec_macros" } serde = "1" -serde_yaml = "0.9.30" +serde_yaml = "0.9" [package] name = "compose_spec" @@ -38,10 +38,10 @@ workspace = true compose_spec_macros.workspace = true indexmap = { version = "2", features = ["serde"] } serde = { workspace = true, features = ["derive"] } -serde-untagged = "0.1.5" +serde-untagged = "0.1" serde_yaml.workspace = true -thiserror = "1.0.56" -url = { version = "2.5", features = ["serde"] } +thiserror = "1.0.7" +url = { version = "2.3", features = ["serde"] } [dev-dependencies] -proptest = "1.4" +proptest = "1" diff --git a/compose_spec_macros/Cargo.toml b/compose_spec_macros/Cargo.toml index 315f11f..bc9e69d 100644 --- a/compose_spec_macros/Cargo.toml +++ b/compose_spec_macros/Cargo.toml @@ -16,9 +16,9 @@ proc-macro = true workspace = true [dependencies] -proc-macro2 = "1.0.78" -quote = "1.0.35" -syn = "2.0.48" +proc-macro2 = "1" +quote = "1" +syn = "2" [dev-dependencies] serde.workspace = true From 511977e412f35e189a3a32931d74cdf7b44b8ce5 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Tue, 20 Feb 2024 15:08:05 -0600 Subject: [PATCH 4/6] ci: add doc, docs-rs, spellcheck, msrv, and minimal-versions jobs --- .github/workflows/ci.yaml | 78 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 96da442..daa6971 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,8 +50,82 @@ jobs: - name: Build run: cargo build --verbose --workspace - - name: Tests + - name: Run Tests run: cargo test --verbose --workspace - - name: Ignored (Slow) Tests + - name: Run Ignored (Slow) Tests run: cargo test --verbose --workspace -- --ignored + + doc: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Rust Toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rust-docs + + - name: Build docs + env: + RUSTDOCFLAGS: "-Dwarnings" + run: cargo doc --verbose --workspace --document-private-items + + docs-rs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Rust Nightly Toolchain + uses: dtolnay/rust-toolchain@nightly + + - name: Install cargo-docs-rs + uses: dtolnay/install@cargo-docs-rs + + - name: Build docs as docs.rs does + run: cargo docs-rs --verbose + + spellcheck: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Typos + uses: crate-ci/typos@v1 + + msrv: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install cargo-msrv + uses: taiki-e/install-action@v2 + with: + tools: cargo-msrv@0.16.0-beta.20 + + - name: Verify MSRV + run: cargo msrv verify + + minimal-versions: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Rust Nightly Toolchain + uses: dtolnay/rust-toolchain@nightly + + - name: Install cargo-minimal-versions + uses: taiki-e/install-action@v2 + with: + tools: cargo-hack,cargo-minimal-versions + + - name: Check Minimal Versions of Dependencies + run: cargo minimal-versions check --workspace + + - name: Test Minimal Versions of Dependencies + run: cargo minimal-versions test --workspace From 26c3fd7a7fac58e3c14d65d94351b7cd84c7ec30 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Tue, 20 Feb 2024 15:21:11 -0600 Subject: [PATCH 5/6] ci: fix tool installs --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index daa6971..8e8842f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -94,7 +94,7 @@ jobs: uses: actions/checkout@v4 - name: Typos - uses: crate-ci/typos@v1 + uses: crate-ci/typos@v1.18.2 msrv: runs-on: ubuntu-latest @@ -105,7 +105,7 @@ jobs: - name: Install cargo-msrv uses: taiki-e/install-action@v2 with: - tools: cargo-msrv@0.16.0-beta.20 + tool: cargo-msrv@0.16.0-beta.20 - name: Verify MSRV run: cargo msrv verify @@ -122,7 +122,7 @@ jobs: - name: Install cargo-minimal-versions uses: taiki-e/install-action@v2 with: - tools: cargo-hack,cargo-minimal-versions + tool: cargo-hack,cargo-minimal-versions - name: Check Minimal Versions of Dependencies run: cargo minimal-versions check --workspace From 4724abc67a74d06b17fa6fe5eabe721fa16a65de Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Tue, 20 Feb 2024 15:35:32 -0600 Subject: [PATCH 6/6] ci: fix cargo-msrv install --- .github/workflows/ci.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8e8842f..4eaa9ac 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -102,10 +102,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install cargo-msrv + - name: Install cargo-binstall uses: taiki-e/install-action@v2 with: - tool: cargo-msrv@0.16.0-beta.20 + tool: cargo-binstall + + - name: Install cargo-msrv + run: cargo binstall --version 0.16.0-beta.20 --no-confirm cargo-msrv - name: Verify MSRV run: cargo msrv verify