Skip to content

Commit

Permalink
Merge pull request #5 from k9withabone/setup-ci
Browse files Browse the repository at this point in the history
Set Up CI
  • Loading branch information
k9withabone authored Feb 20, 2024
2 parents 51a31d8 + 4724abc commit bee57a0
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 8 deletions.
134 changes: 134 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
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: Run Tests
run: cargo test --verbose --workspace

- 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/[email protected]

msrv:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install cargo-binstall
uses: taiki-e/install-action@v2
with:
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

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:
tool: 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
12 changes: 7 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ 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"

[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"
Expand All @@ -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"]
Expand All @@ -36,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"
7 changes: 4 additions & 3 deletions compose_spec_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -15,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
Expand Down

0 comments on commit bee57a0

Please sign in to comment.