Impl serde::Serialize and serde::Deserialize for TimeDelta #3481
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: All Tests and Builds | |
env: | |
# It's really `--all-features`, but not adding the mutually exclusive features from rkyv | |
ALL_NON_EXCLUSIVE_FEATURES: --features "default unstable-locales rkyv-32 rkyv-validation serde arbitrary" | |
on: | |
push: | |
branches: [main, 0.5.x] | |
pull_request: | |
jobs: | |
timezones: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
tz: ["ACST-9:30", "EST4", "UTC0", "Asia/Katmandu"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo test ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always | |
# later this may be able to be included with the below | |
# kept separate for now as the following don't compile on 1.60 | |
# * arbitrary (requires 1.63 as of v1.3.0) | |
rust_msrv: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: "1.61.0" | |
- uses: Swatinem/rust-cache@v2 | |
# run --lib and --doc to avoid the long running integration tests | |
# which are run elsewhere | |
- run: | | |
cargo test --lib \ | |
--features \ | |
unstable-locales,wasmbind,oldtime,clock,winapi,serde \ | |
--color=always -- --color=always | |
- run: | | |
cargo test --doc \ | |
--features \ | |
unstable-locales,wasmbind,oldtime,clock,winapi,serde \ | |
--color=always -- --color=always | |
rust_versions: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
rust_version: ["stable", "beta", "nightly"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust_version }} | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo check --manifest-path bench/Cargo.toml --benches | |
- run: cargo check --manifest-path fuzz/Cargo.toml --all-targets | |
# run --lib and --doc to avoid the long running integration tests | |
# which are run elsewhere | |
- run: cargo test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always | |
- run: cargo test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always | |
features_check: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: taiki-e/install-action@cargo-hack | |
- uses: Swatinem/rust-cache@v2 | |
- run: | | |
cargo hack check --feature-powerset --optional-deps arbitrary,serde \ | |
--skip __internal_bench,iana-time-zone,oldtime,pure-rust-locales,libc,winapi,rkyv-validation,wasmbind \ | |
--mutually-exclusive-features arbitrary,rkyv,rkyv-16,rkyv-32,rkyv-64,serde \ | |
--all-targets | |
# run using `bash` on all platforms for consistent | |
# line-continuation marks | |
shell: bash | |
env: | |
RUSTFLAGS: "-D warnings" | |
- run: cargo test --no-default-features | |
- run: cargo test --no-default-features --features=alloc | |
- run: cargo test --no-default-features --features=unstable-locales | |
- run: cargo test --no-default-features --features=alloc,unstable-locales | |
- run: cargo test --no-default-features --features=now | |
no_std: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
target: [thumbv6m-none-eabi, x86_64-fortanix-unknown-sgx] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo build --target ${{ matrix.target }} --color=always | |
working-directory: ./ci/core-test | |
alternative_targets: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
target: | |
[ | |
wasm32-unknown-emscripten, | |
aarch64-apple-ios, | |
aarch64-linux-android, | |
] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo build --target ${{ matrix.target }} --color=always | |
test_wasm: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions/setup-node@v4 | |
- uses: jetli/[email protected] | |
# The `TZ` and `NOW` variables are used to compare the results inside the WASM environment | |
# with the host system. | |
- run: TZ="$(date +%z)" NOW="$(date +%s)" wasm-pack test --node -- --features wasmbind | |
test_wasi: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
target: | |
- wasm32-wasi | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-wasi | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo install cargo-wasi | |
- uses: mwilliamson/setup-wasmtime-action@v2 | |
with: | |
wasmtime-version: "12.0.1" | |
# We can't use `--all-features` because rkyv uses the mutually-exclusive-feature pattern | |
- run: cargo wasi test --features=serde,unstable-locales --color=always -- --color=always | |
cross-targets: | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-illumos | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cargo install cross | |
- uses: Swatinem/rust-cache@v2 | |
- run: cross check --target ${{ matrix.target }} | |
cross-tests: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cargo install cross | |
- uses: Swatinem/rust-cache@v2 | |
- run: cross test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-gnu --color=always | |
- run: cross test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-gnu --color=always | |
- run: cross test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-musl --color=always | |
- run: cross test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-musl --color=always | |
check-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- run: cargo +nightly doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --no-deps | |
env: | |
RUSTDOCFLAGS: "-D warnings --cfg docsrs" |