1name: CI 2 3on: 4 push: 5 pull_request: 6 schedule: [cron: "40 1 * * *"] 7 8permissions: 9 contents: read 10 11env: 12 RUSTFLAGS: -Dwarnings 13 14jobs: 15 test: 16 name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} 17 runs-on: ${{matrix.os}}-latest 18 strategy: 19 fail-fast: false 20 matrix: 21 os: [ubuntu, windows] 22 timeout-minutes: 45 23 steps: 24 - uses: actions/checkout@v3 25 - uses: dtolnay/rust-toolchain@nightly 26 - run: cargo test 27 - run: cargo test --features preserve_order --tests -- --skip ui --exact 28 - run: cargo test --features float_roundtrip --tests -- --skip ui --exact 29 - run: cargo test --features arbitrary_precision --tests -- --skip ui --exact 30 - run: cargo test --features float_roundtrip,arbitrary_precision --tests -- --skip ui --exact 31 - run: cargo test --features raw_value --tests -- --skip ui --exact 32 - run: cargo test --features unbounded_depth --tests -- --skip ui --exact 33 34 build: 35 name: Rust ${{matrix.rust}} ${{matrix.os == 'windows' && '(windows)' || ''}} 36 runs-on: ${{matrix.os}}-latest 37 strategy: 38 fail-fast: false 39 matrix: 40 rust: [beta, 1.56.1, 1.53.0, 1.46.0, 1.40.0, 1.38.0, 1.36.0] 41 os: [ubuntu] 42 include: 43 - rust: stable 44 os: ubuntu 45 target: aarch64-unknown-none 46 - rust: stable 47 os: windows 48 timeout-minutes: 45 49 steps: 50 - uses: actions/checkout@v3 51 - uses: dtolnay/rust-toolchain@master 52 with: 53 toolchain: ${{matrix.rust}} 54 targets: ${{matrix.target}} 55 - run: cargo check 56 - run: cargo check --features float_roundtrip 57 - run: cargo check --features arbitrary_precision 58 - run: cargo check --features raw_value 59 - run: cargo check --features unbounded_depth 60 - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features --features alloc 61 - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features --features alloc,arbitrary_precision 62 - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features --features alloc,raw_value 63 - run: cargo check --features preserve_order 64 if: matrix.rust != '1.53.0' && matrix.rust != '1.46.0' && matrix.rust != '1.45.0' && matrix.rust != '1.40.0' && matrix.rust != '1.38.0' && matrix.rust != '1.36.0' 65 - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features --features alloc,preserve_order 66 if: matrix.rust != '1.53.0' && matrix.rust != '1.46.0' && matrix.rust != '1.45.0' && matrix.rust != '1.40.0' && matrix.rust != '1.38.0' && matrix.rust != '1.36.0' 67 - name: Build without std 68 run: cargo check --manifest-path tests/crate/Cargo.toml --target ${{matrix.target}} --no-default-features --features alloc 69 if: matrix.target 70 71 miri: 72 name: Miri 73 runs-on: ubuntu-latest 74 env: 75 MIRIFLAGS: -Zmiri-strict-provenance 76 timeout-minutes: 45 77 steps: 78 - uses: actions/checkout@v3 79 - uses: dtolnay/rust-toolchain@miri 80 - run: cargo miri test 81 - run: cargo miri test --features preserve_order,float_roundtrip,arbitrary_precision,raw_value 82 83 clippy: 84 name: Clippy 85 runs-on: ubuntu-latest 86 if: github.event_name != 'pull_request' 87 timeout-minutes: 45 88 steps: 89 - uses: actions/checkout@v3 90 - uses: dtolnay/rust-toolchain@clippy 91 - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic 92 - run: cargo clippy --all-features --tests -- -Dclippy::all -Dclippy::pedantic 93 94 docs: 95 name: Documentation 96 runs-on: ubuntu-latest 97 timeout-minutes: 45 98 steps: 99 - uses: actions/checkout@v3 100 - uses: dtolnay/rust-toolchain@nightly 101 - run: cargo doc --features raw_value,unbounded_depth 102 env: 103 RUSTDOCFLAGS: --cfg docsrs 104 105 fuzz: 106 name: Fuzz 107 runs-on: ubuntu-latest 108 timeout-minutes: 45 109 steps: 110 - uses: actions/checkout@v3 111 - uses: dtolnay/rust-toolchain@nightly 112 - uses: dtolnay/install@cargo-fuzz 113 - run: cargo fuzz check 114 115 outdated: 116 name: Outdated 117 runs-on: ubuntu-latest 118 if: github.event_name != 'pull_request' 119 timeout-minutes: 45 120 steps: 121 - uses: actions/checkout@v3 122 - uses: dtolnay/install@cargo-outdated 123 - run: cargo outdated --workspace --exit-code 1 124 - run: cargo outdated --manifest-path fuzz/Cargo.toml --exit-code 1 125