Skip to content

Removed MIGHT_BE_ZERO_COPY, as IS_ZERO_COPY subsumes it (final part) #662

Removed MIGHT_BE_ZERO_COPY, as IS_ZERO_COPY subsumes it (final part)

Removed MIGHT_BE_ZERO_COPY, as IS_ZERO_COPY subsumes it (final part) #662

Workflow file for this run

name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check formatting
run: cargo fmt -- --check
- name: Clippy (default)
run: cargo clippy -- -D warnings
- name: Clippy (no default features)
run: cargo clippy --no-default-features --features derive -- -D warnings
- name: Clippy (all features)
run: cargo clippy --all-features -- -D warnings
build:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
rust:
- 1.85.0
- stable
- beta
- nightly
features:
- ""
- "--no-default-features --features 'derive'"
- "--all-features"
steps:
- name: Install rust (${{ matrix.rust }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
# rust-src so the trybuild compile-fail snapshots, which include
# `::: $RUST/...` std source snippets, render the same way they do
# locally (where rust-analyzer pulls in rust-src).
components: rust-src
- uses: actions/checkout@v6
- name: Build
run: cargo build ${{ matrix.features }} --verbose
- name: Run tests excluding trybuild tests
run: cargo test ${{ matrix.features }} --verbose -- --skip fail
# Compile-fail (trybuild) snapshots are tied to the compiler's diagnostic
# rendering, so they are checked only on the current stable toolchain
# (and a single feature combination, as the errors are feature-independent).
- name: Run trybuild compile-fail tests (current compiler only)
if: matrix.rust == 'stable' && matrix.features == ''
run: cargo test --test fail --verbose
- name: Run examples
working-directory: ./epserde
run: for example in examples/*.rs ; do cargo run --example "$(basename "${example%.rs}")" ; done
miri:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v6
- name: Install nightly with Miri
uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- name: Run Miri tests (Tree Borrows)
run: MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-tree-borrows" cargo +nightly miri test --no-default-features --features std,derive
- name: Run Miri tests (Stacked Borrows)
run: MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test --no-default-features --features std,derive
coverage:
needs: build
name: coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Generate code coverage
run: |
cargo +nightly tarpaulin --verbose --engine llvm --all-features --workspace --out Lcov -- --skip fail
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "lcov.info"
build-i686:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install rust (1.85.0)
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.85.0
targets: i686-unknown-linux-gnu
- name: Install 32-bit support
run: sudo apt-get update && sudo apt-get install -y gcc-multilib
- name: Build (32-bit)
run: cargo build --target i686-unknown-linux-gnu
# Skip the trybuild compile-fail tests: their .stderr snapshots track the
# current stable compiler (see the build job), not the pinned 1.85.0
# toolchain used here, whose diagnostic rendering differs.
- name: Test (32-bit)
run: cargo test --target i686-unknown-linux-gnu -- --skip fail