name: CI on: push: pull_request: workflow_dispatch: schedule: [cron: "40 1 * * *"] permissions: contents: read env: RUSTFLAGS: -Dwarnings jobs: test: name: Test suite runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly - run: cd test_suite && cargo test --features unstable windows: name: Test suite (windows) runs-on: windows-latest timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly - run: cd test_suite && cargo test --features unstable -- --skip ui --exact stable: name: Rust ${{matrix.rust}} runs-on: ubuntu-latest strategy: fail-fast: false matrix: rust: [stable, beta] timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust}} - run: cd serde && cargo build --features rc - run: cd serde && cargo build --no-default-features nightly: name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} runs-on: ${{matrix.os}}-latest strategy: fail-fast: false matrix: os: [ubuntu, windows] timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly - run: cd serde && cargo build - run: cd serde && cargo build --no-default-features - run: cd serde && cargo build --no-default-features --features alloc - run: cd serde && cargo build --no-default-features --features rc,alloc - run: cd serde && cargo build --no-default-features --features unstable - run: cd serde && cargo test --features derive,rc,unstable - run: cd test_suite/no_std && cargo build if: matrix.os != 'windows' - run: cd serde_derive && cargo check --tests env: RUSTFLAGS: --cfg exhaustive ${{env.RUSTFLAGS}} if: matrix.os != 'windows' build: name: Rust ${{matrix.rust}} runs-on: ubuntu-latest strategy: fail-fast: false matrix: rust: [1.31.0, 1.34.0] timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust}} - run: cd serde && cargo build --features rc - run: cd serde && cargo build --no-default-features - run: cd serde && cargo build derive: name: Rust 1.56.0 runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@1.56.0 - run: cd serde && cargo check --no-default-features - run: cd serde && cargo check - run: cd serde_derive && cargo check - run: cd precompiled/serde_derive && cargo check alloc: name: Rust 1.36.0 runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@1.36.0 - run: cd serde && cargo build --no-default-features --features alloc precompiled: name: Precompiled runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly with: components: rust-src targets: x86_64-unknown-linux-musl - run: precompiled/build.sh - name: replace serde_derive dependency with precompiled run: | # FIXME: consider using `cargo rm serde_derive` but it's currently broken # https://github.com/rust-lang/cargo/issues/12419 sed -i '/serde_derive =/d' serde/Cargo.toml sed -i '/derive = \["serde_derive"\]/d' serde/Cargo.toml sed -i '/"serde_derive"/d' Cargo.toml sed -i '/\[workspace\]/d' precompiled/serde_derive/Cargo.toml cargo add --dev serde_derive --path precompiled/serde_derive --manifest-path test_suite/Cargo.toml git diff - run: cd test_suite && cargo test --features unstable -- --skip ui --exact macos: name: macOS runs-on: macos-latest timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - run: cd precompiled/serde_derive && cargo check minimal: name: Minimal versions runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly - run: cargo generate-lockfile -Z minimal-versions - run: cargo check --locked --workspace clippy: name: Clippy runs-on: ubuntu-latest if: github.event_name != 'pull_request' timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@clippy - run: cd serde && cargo clippy --features rc,unstable -- -Dclippy::all -Dclippy::pedantic - run: cd serde_derive && cargo clippy -- -Dclippy::all -Dclippy::pedantic - run: cd serde_derive_internals && cargo clippy -- -Dclippy::all -Dclippy::pedantic - run: cd test_suite && cargo clippy --tests --features unstable -- -Dclippy::all -Dclippy::pedantic - run: cd test_suite/no_std && cargo clippy -- -Dclippy::all -Dclippy::pedantic miri: name: Miri runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@miri - run: cargo miri setup - run: cd serde && cargo miri test --features derive,rc,unstable env: MIRIFLAGS: -Zmiri-strict-provenance - run: cd test_suite && cargo miri test --features unstable env: MIRIFLAGS: -Zmiri-strict-provenance outdated: name: Outdated runs-on: ubuntu-latest if: github.event_name != 'pull_request' timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: dtolnay/install@cargo-outdated - run: cargo outdated --workspace --exit-code 1