• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: lint
2
3env:
4  # It's really `--all-features`, but not adding the mutually exclusive features from rkyv
5  ALL_NON_EXCLUSIVE_FEATURES: --features "default unstable-locales rkyv-64 rkyv-validation rustc-serialize serde arbitrary"
6
7on:
8  push:
9    branches: [main, 0.4.x]
10  pull_request:
11
12jobs:
13  lint:
14    runs-on: ubuntu-latest
15
16    steps:
17      - uses: actions/checkout@v4
18      - uses: dtolnay/rust-toolchain@stable
19        with:
20          targets: x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc
21      - uses: Swatinem/rust-cache@v2
22      - run: cargo fmt --check -- --color=always
23      - run: cargo fmt --check --manifest-path fuzz/Cargo.toml
24      - run: cargo fmt --check --manifest-path bench/Cargo.toml
25      - run: |
26          cargo clippy ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --all-targets --color=always \
27            -- -D warnings
28      - run: |
29          cargo clippy --manifest-path fuzz/Cargo.toml --color=always \
30            -- -D warnings
31      - run: |
32          cargo clippy --manifest-path bench/Cargo.toml --color=always \
33            -- -D warnings
34        env:
35          RUSTFLAGS: "-Dwarnings"
36
37  toml:
38    runs-on: ubuntu-latest
39    container:
40      image: tamasfe/taplo:0.8.0
41    steps:
42      - uses: actions/checkout@v4
43      - run: taplo lint
44      - run: taplo fmt --check --diff
45
46  cargo-deny:
47    runs-on: ubuntu-latest
48    steps:
49      - uses: actions/checkout@v4
50      - uses: EmbarkStudios/cargo-deny-action@v1
51
52  check-doc:
53    runs-on: ubuntu-latest
54    steps:
55      - uses: actions/checkout@v4
56      - uses: dtolnay/rust-toolchain@stable
57      - run: cargo install cargo-deadlinks
58      - run: cargo deadlinks -- ${{ env.ALL_NON_EXCLUSIVE_FEATURES }}
59      - run: cargo doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --no-deps
60        env:
61          RUSTDOCFLAGS: -Dwarnings
62
63  cffconvert:
64    runs-on: ubuntu-latest
65    steps:
66      - uses: actions/checkout@v4
67        with:
68          persist-credentials: false
69      - uses: citation-file-format/cffconvert-github-action@2.0.0
70        with:
71          args: --validate
72