serde/.github/workflows/ci.yml

191 lines
6.2 KiB
YAML
Raw Normal View History

2020-05-05 13:33:56 -05:00
name: CI
2020-05-03 03:46:11 -05:00
on:
push:
pull_request:
schedule: [cron: "40 1 * * *"]
2022-01-01 13:52:55 -06:00
env:
RUSTFLAGS: -Dwarnings
2020-05-03 03:46:11 -05:00
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
2020-05-05 18:51:54 -05:00
windows:
name: Test suite (windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
2020-05-05 18:51:54 -05:00
- uses: dtolnay/rust-toolchain@nightly
- run: cd test_suite && cargo test --features unstable -- --skip ui --exact
2020-05-03 03:46:11 -05:00
stable:
2021-04-19 21:54:56 -05:00
name: Rust ${{matrix.rust}}
2020-05-03 03:46:11 -05:00
runs-on: ubuntu-latest
2021-04-19 21:54:56 -05:00
strategy:
fail-fast: false
matrix:
rust: [stable, beta]
2020-05-03 03:46:11 -05:00
steps:
- uses: actions/checkout@v3
2021-04-19 21:54:56 -05:00
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
2020-05-03 03:46:11 -05:00
- 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:
2020-05-05 18:51:54 -05:00
name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}}
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows]
2020-05-03 03:46:11 -05:00
steps:
- uses: actions/checkout@v3
2020-05-03 03:46:11 -05:00
- 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
2020-05-05 18:51:54 -05:00
if: matrix.os != 'windows'
- run: cd serde_derive && cargo check --tests
env:
RUSTFLAGS: --cfg exhaustive ${{env.RUSTFLAGS}}
if: matrix.os != 'windows'
2020-05-03 03:46:11 -05:00
msrv:
name: Rust 1.13.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2020-05-03 03:46:11 -05:00
- 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}}
2020-05-03 03:46:11 -05:00
- 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
2020-05-03 03:46:11 -05:00
- 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
2020-05-03 03:46:11 -05:00
- 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
2020-05-10 00:35:08 -05:00
derive:
name: Rust 1.31.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2020-05-10 00:35:08 -05:00
- uses: dtolnay/rust-toolchain@1.31.0
2021-01-24 22:42:20 -06:00
- run: cd serde && cargo check --no-default-features
- run: cd serde && cargo check
2020-05-10 00:35:08 -05:00
- run: cd serde_derive && cargo check
2020-05-03 03:46:11 -05:00
alloc:
name: Rust 1.36.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2020-05-03 03:46:11 -05:00
- 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
2020-05-03 03:46:11 -05:00
- 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
- 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
- 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
2022-04-28 22:43:03 -05:00
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
2022-04-28 22:43:03 -05:00
- 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 --exit-code 1