Skip to content

Add dataclass and pydantic support with simplified implementation #154

Add dataclass and pydantic support with simplified implementation

Add dataclass and pydantic support with simplified implementation #154

Workflow file for this run

name: Rust
permissions:
contents: read
on:
push:
branches:
- "main"
pull_request:
workflow_dispatch:
jobs:
doc-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Check warnings in documents
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps
env:
RUSTDOCFLAGS: -D warnings
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Check with clippy
uses: actions-rs/clippy-check@v1
with:
args: --all-features -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pydantic: [true, false]
abi3: [true, false]
name: Test (pydantic=${{ matrix.pydantic }}, abi3=${{ matrix.abi3 }})
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Install pydantic
if: matrix.pydantic
run: pip install pydantic
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.abi3 && '--features pyo3/abi3' || '' }}
semver-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
package: serde-pyobject