diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b50a7ff..05bff4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,54 +1,79 @@ name: CI on: - pull_request: # Need to run on pull-requests, otherwise PRs from forks don't run + pull_request: push: branches: - main jobs: - static_analysis: + lint: + name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: Swatinem/rust-cache@v2.2.0 - - uses: dprint/check@v2.1 - - run: cargo clippy --workspace --all-targets -- -D warnings + - uses: actions/checkout@v4 - msrv: + - uses: dtolnay/rust-toolchain@master + with: + components: clippy,rustfmt + toolchain: stable + + - run: cargo fmt --all --check + + - run: cargo clippy --workspace --all-targets --all-features -- -D warnings + + mdtomlfmt: + name: Generic format (md,toml) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run dprint + run: | + curl -fsSL https://dprint.dev/install.sh | sh + /home/runner/.dprint/bin/dprint check + + build_msrv: + name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: 1.63 + + - uses: Swatinem/rust-cache@v2.7.0 + + - run: cargo build --workspace --all-features + + build_features: + name: Build with varying features + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable - - name: Install Rust - uses: actions-rs/toolchain@v1.0.7 - with: - toolchain: 1.41 # MSRV - override: true - profile: minimal + - run: cargo install cargo-hack - - uses: Swatinem/rust-cache@v2.2.0 + - uses: Swatinem/rust-cache@v2.7.0 - - run: cargo build + - run: cargo hack build --workspace --each-feature test: - strategy: - matrix: - rust: [ - stable, - nightly - ] + name: Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install Rust ${{ matrix.rust }} - uses: actions-rs/toolchain@v1.0.7 - with: - toolchain: ${{ matrix.rust }} - override: true - profile: minimal + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable - - uses: Swatinem/rust-cache@v2.2.0 + - uses: Swatinem/rust-cache@v2.7.0 - - run: cargo test + - run: cargo test --workspace --all-features diff --git a/CHANGELOG.md b/CHANGELOG.md index 42c757b..2289a7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Updated Rust version to 2021 and bumped MSRV to 1.63 ([#52](https://github.com/monero-rs/monero-epee-bin-serde/pull/37)). + ### Fixed - Deserialization of nested structs ([#37](https://github.com/monero-rs/monero-epee-bin-serde/pull/37)). diff --git a/Cargo.toml b/Cargo.toml index d528a73..5fb71a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "monero-epee-bin-serde" version = "1.0.1" -authors = [ "CoBloX Team " ] +authors = ["Monero Rust Contributors", "CoBloX Team "] documentation = "https://docs.rs/monero-epee-bin-serde" -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" -repository = "https://github.com/comit-network/monero-epee-bin-serde" +repository = "https://github.com/monero-rs/monero-epee-bin-serde" +rust-version = "1.63.0" description = "A serde format for the binary encoding defined within the epee helper library of Monero." [dependencies] @@ -14,7 +15,7 @@ serde = "1" [dev-dependencies] hex = "0.4" -hex-literal = "0.3" -monero = "0.18" -serde = { version = "1", features = [ "derive" ] } -serde_with = "1" +hex-literal = "0.4" +monero = "0.19" +serde = { version = "1", features = ["derive"] } +serde_with = "3" diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 63c1d0e..0000000 --- a/bors.toml +++ /dev/null @@ -1,6 +0,0 @@ -status = [ - "static_analysis", - "msrv", - "test (stable)", - # test (nightly) failing tests on nightly are fine -] diff --git a/dprint.json b/dprint.json index add779a..010786d 100644 --- a/dprint.json +++ b/dprint.json @@ -1,22 +1,13 @@ { - "$schema": "https://dprint.dev/schemas/v0.json", - "projectType": "openSource", "incremental": true, - "json": { - }, "markdown": { }, - "rustfmt": { + "toml": { }, - "includes": ["**/*.{json,md,rs,toml}"], - "excludes": [ - "**/*-lock.json", - "**/target" - ], + "includes": ["**/*.{md,toml}"], + "excludes": ["target"], "plugins": [ - "https://plugins.dprint.dev/json-0.10.2.wasm", - "https://plugins.dprint.dev/markdown-0.7.1.wasm", - "https://plugins.dprint.dev/rustfmt-0.3.0.wasm", - "https://github.com/thomaseizinger/dprint-plugin-cargo-toml/releases/download/0.1.0/cargo-toml-0.1.0.wasm" + "https://plugins.dprint.dev/markdown-0.13.3.wasm", + "https://plugins.dprint.dev/toml-0.5.4.wasm" ] -} +} \ No newline at end of file