• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2
3on:
4  push:
5  pull_request:
6  workflow_dispatch:
7  schedule: [cron: "40 1 * * *"]
8
9permissions:
10  contents: read
11
12env:
13  RUSTFLAGS: -Dwarnings
14
15jobs:
16  test:
17    name: Test suite
18    runs-on: ubuntu-latest
19    timeout-minutes: 45
20    steps:
21      - uses: actions/checkout@v4
22      - uses: dtolnay/rust-toolchain@nightly
23      - run: cd test_suite && cargo test --features unstable
24
25  windows:
26    name: Test suite (windows)
27    runs-on: windows-latest
28    timeout-minutes: 45
29    steps:
30      - uses: actions/checkout@v4
31      - uses: dtolnay/rust-toolchain@nightly
32      - run: cd test_suite && cargo test --features unstable -- --skip ui --exact
33
34  stable:
35    name: Rust ${{matrix.rust}}
36    runs-on: ubuntu-latest
37    strategy:
38      fail-fast: false
39      matrix:
40        rust: [stable, beta]
41    timeout-minutes: 45
42    steps:
43      - uses: actions/checkout@v4
44      - uses: dtolnay/rust-toolchain@master
45        with:
46          toolchain: ${{matrix.rust}}
47      - run: cd serde && cargo build --features rc
48      - run: cd serde && cargo build --no-default-features
49
50  nightly:
51    name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}}
52    runs-on: ${{matrix.os}}-latest
53    strategy:
54      fail-fast: false
55      matrix:
56        os: [ubuntu, windows]
57    timeout-minutes: 45
58    steps:
59      - uses: actions/checkout@v4
60      - uses: dtolnay/rust-toolchain@nightly
61      - run: cd serde && cargo build
62      - run: cd serde && cargo build --no-default-features
63      - run: cd serde && cargo build --no-default-features --features alloc
64      - run: cd serde && cargo build --no-default-features --features rc,alloc
65      - run: cd serde && cargo build --no-default-features --features unstable
66      - run: cd serde && cargo test --features derive,rc,unstable
67      - run: cd test_suite/no_std && cargo build
68        if: matrix.os != 'windows'
69      - run: cd serde_derive && cargo check --tests
70        env:
71          RUSTFLAGS: --cfg exhaustive ${{env.RUSTFLAGS}}
72        if: matrix.os != 'windows'
73
74  build:
75    name: Rust ${{matrix.rust}}
76    runs-on: ubuntu-latest
77    strategy:
78      fail-fast: false
79      matrix:
80        rust: [1.31.0, 1.34.0]
81    timeout-minutes: 45
82    steps:
83      - uses: actions/checkout@v4
84      - uses: dtolnay/rust-toolchain@master
85        with:
86          toolchain: ${{matrix.rust}}
87      - run: cd serde && cargo build --features rc
88      - run: cd serde && cargo build --no-default-features
89      - run: cd serde && cargo build
90
91  derive:
92    name: Rust 1.56.0
93    runs-on: ubuntu-latest
94    timeout-minutes: 45
95    steps:
96      - uses: actions/checkout@v4
97      - uses: dtolnay/rust-toolchain@1.56.0
98      - run: cd serde && cargo check --no-default-features
99      - run: cd serde && cargo check
100      - run: cd serde_derive && cargo check
101
102  alloc:
103    name: Rust 1.36.0
104    runs-on: ubuntu-latest
105    timeout-minutes: 45
106    steps:
107      - uses: actions/checkout@v4
108      - uses: dtolnay/rust-toolchain@1.36.0
109      - run: cd serde && cargo build --no-default-features --features alloc
110
111  minimal:
112    name: Minimal versions
113    runs-on: ubuntu-latest
114    timeout-minutes: 45
115    steps:
116      - uses: actions/checkout@v4
117      - uses: dtolnay/rust-toolchain@nightly
118      - run: cargo generate-lockfile -Z minimal-versions
119      - run: cargo check --locked --workspace
120
121  doc:
122    name: Documentation
123    runs-on: ubuntu-latest
124    timeout-minutes: 45
125    env:
126      RUSTDOCFLAGS: -Dwarnings
127    steps:
128      - uses: actions/checkout@v4
129      - uses: dtolnay/rust-toolchain@nightly
130      - uses: dtolnay/install@cargo-docs-rs
131      - run: cargo docs-rs -p serde
132      - run: cargo docs-rs -p serde_derive
133      - run: cargo docs-rs -p serde_derive_internals
134
135  clippy:
136    name: Clippy
137    runs-on: ubuntu-latest
138    if: github.event_name != 'pull_request'
139    timeout-minutes: 45
140    steps:
141      - uses: actions/checkout@v4
142      - uses: dtolnay/rust-toolchain@clippy
143      - run: cd serde && cargo clippy --features rc,unstable -- -Dclippy::all -Dclippy::pedantic
144      - run: cd serde_derive && cargo clippy -- -Dclippy::all -Dclippy::pedantic
145      - run: cd serde_derive_internals && cargo clippy -- -Dclippy::all -Dclippy::pedantic
146      - run: cd test_suite && cargo clippy --tests --features unstable -- -Dclippy::all -Dclippy::pedantic
147      - run: cd test_suite/no_std && cargo clippy -- -Dclippy::all -Dclippy::pedantic
148
149  miri:
150    name: Miri
151    runs-on: ubuntu-latest
152    timeout-minutes: 45
153    steps:
154      - uses: actions/checkout@v4
155      - uses: dtolnay/rust-toolchain@miri
156      - run: cargo miri setup
157      - run: cd serde && cargo miri test --features derive,rc,unstable
158        env:
159          MIRIFLAGS: -Zmiri-strict-provenance
160      - run: cd test_suite && cargo miri test --features unstable
161        env:
162          MIRIFLAGS: -Zmiri-strict-provenance
163
164  outdated:
165    name: Outdated
166    runs-on: ubuntu-latest
167    if: github.event_name != 'pull_request'
168    timeout-minutes: 45
169    steps:
170      - uses: actions/checkout@v4
171      - uses: dtolnay/install@cargo-outdated
172      - run: cargo outdated --workspace --exit-code 1
173