serde/.github/workflows/ci.yml
David Tolnay d208762c81
Command-line ignore let_underscore_drop clippy lint
For whatever reason, the #![cfg_attr(feature = "cargo-clippy", allow(let_underscore_drop))]
attributes already in the code stopped working in the most recent nightly (2022-09-03).
Likely in connection with https://github.com/rust-lang/rust/pull/97739 ?

    error: non-binding `let` on a type that implements `Drop`
       --> serde/src/de/mod.rs:958:13
        |
    958 |             let _ = visitor;
        |             ^^^^^^^^^^^^^^^^
        |
        = note: `-D clippy::let-underscore-drop` implied by `-D clippy::pedantic`
        = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

    error: non-binding `let` on a type that implements `Drop`
       --> serde/src/de/mod.rs:992:13
        |
    992 |             let _ = visitor;
        |             ^^^^^^^^^^^^^^^^
        |
        = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

    error: non-binding `let` on a type that implements `Drop`
        --> serde/src/de/mod.rs:1616:9
         |
    1616 |         let _ = deserializer;
         |         ^^^^^^^^^^^^^^^^^^^^^
         |
         = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

    error: non-binding `let` on a type that implements `Drop`
        --> serde/src/de/mod.rs:1640:9
         |
    1640 |         let _ = deserializer;
         |         ^^^^^^^^^^^^^^^^^^^^^
         |
         = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

    error: non-binding `let` on a type that implements `Drop`
        --> serde/src/de/mod.rs:1651:9
         |
    1651 |         let _ = seq;
         |         ^^^^^^^^^^^^
         |
         = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

    error: non-binding `let` on a type that implements `Drop`
        --> serde/src/de/mod.rs:1662:9
         |
    1662 |         let _ = map;
         |         ^^^^^^^^^^^^
         |
         = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

    error: non-binding `let` on a type that implements `Drop`
        --> serde/src/de/mod.rs:1673:9
         |
    1673 |         let _ = data;
         |         ^^^^^^^^^^^^^
         |
         = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

    error: non-binding `let` on a type that implements `Drop`
        --> serde/src/private/de.rs:1440:13
         |
    1440 |             let _ = visitor;
         |             ^^^^^^^^^^^^^^^^
         |
         = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

    error: non-binding `let` on a type that implements `Drop`
        --> serde/src/private/de.rs:2163:13
         |
    2163 |             let _ = visitor;
         |             ^^^^^^^^^^^^^^^^
         |
         = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop
2022-09-02 21:16:27 -07:00

198 lines
6.5 KiB
YAML

name: CI
on:
push:
pull_request:
schedule: [cron: "40 1 * * *"]
permissions:
contents: read
env:
RUSTFLAGS: -Dwarnings
jobs:
test:
name: Test suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- run: cd test_suite && cargo test --features unstable
- uses: dtolnay/install@cargo-expand
if: github.event_name != 'pull_request'
- run: cd test_suite && cargo test --features expandtest --test expandtest -- --include-ignored
if: github.event_name != 'pull_request'
windows:
name: Test suite (windows)
runs-on: windows-latest
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]
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_test && cargo build
- run: cd serde_test && cargo test --features serde/derive,serde/rc
nightly:
name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}}
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows]
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 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'
msrv:
name: Rust 1.13.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.13.0
- name: Get timestamp for cache
id: date
run: echo ::set-output name=yearmo::$(date +%Y%m)
- uses: actions/cache@v1
with:
path: ~/.cargo/registry/index
key: cargo-registry-index-${{steps.date.outputs.yearmo}}
- run: cd serde && cargo build --features rc
- run: cd serde && cargo build --no-default-features
- run: cd serde_test && cargo build
build:
name: Rust ${{matrix.rust}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [1.19.0, 1.20.0, 1.21.0, 1.25.0, 1.26.0, 1.34.0]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- run: cd serde && cargo build --no-default-features
- run: cd serde && cargo build
more:
name: Rust ${{matrix.rust}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [1.27.0, 1.28.0]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
# Work around failing to parse manifest because editions are unstable.
- run: sed -i /test_suite/d Cargo.toml
- run: cd serde && cargo build --no-default-features
- run: cd serde && cargo build
derive:
name: Rust 1.31.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.31.0
- run: cd serde && cargo check --no-default-features
- run: cd serde && cargo check
- run: cd serde_derive && cargo check
alloc:
name: Rust 1.36.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.36.0
- run: cd serde && cargo build --no-default-features --features alloc
emscripten:
name: Emscripten
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- uses: actions/setup-node@v1
with:
node-version: 9
- name: Install cargo-web
run: |
CARGO_WEB_RELEASE=$(curl -L -s -H Accept:application/json https://github.com/koute/cargo-web/releases/latest)
CARGO_WEB_VERSION=$(echo "${CARGO_WEB_RELEASE}" | jq -r .tag_name)
CARGO_WEB_URL="https://github.com/koute/cargo-web/releases/download/${CARGO_WEB_VERSION}/cargo-web-x86_64-unknown-linux-gnu.gz"
mkdir -p ~/.cargo/bin
curl -L "${CARGO_WEB_URL}" | gzip -d > ~/.cargo/bin/cargo-web
chmod +x ~/.cargo/bin/cargo-web
- run: cd test_suite && cargo web test --target=asmjs-unknown-emscripten --nodejs
continue-on-error: true
- run: cd test_suite && cargo web test --target=wasm32-unknown-emscripten --nodejs
continue-on-error: true
clippy:
name: Clippy
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@clippy
- run: cd serde && cargo clippy --features rc,unstable -- -Dclippy::all -Dclippy::pedantic -Aclippy::let_underscore_drop
- run: cd serde_derive && cargo clippy -- -Dclippy::all -Dclippy::pedantic
- run: cd serde_derive_internals && cargo clippy -- -Dclippy::all -Dclippy::pedantic
- run: cd serde_test && cargo clippy -- -Dclippy::all -Dclippy::pedantic -Aclippy::let_underscore_drop
- run: cd test_suite && cargo clippy --tests --features unstable -- -Dclippy::all -Dclippy::pedantic -Aclippy::let_underscore_drop
- run: cd test_suite/no_std && cargo clippy -- -Dclippy::all -Dclippy::pedantic
miri:
name: Miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@miri
- 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'
steps:
- uses: actions/checkout@v3
- uses: dtolnay/install@cargo-outdated
- run: cargo outdated --workspace --exclude macrotest,prettyplease --exit-code 1