| 1 |
name: CI |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
pull_request: |
| 6 |
workflow_dispatch: |
| 7 |
schedule: [cron: "40 1 * * *"] |
| 8 |
|
| 9 |
permissions: |
| 10 |
contents: read |
| 11 |
|
| 12 |
env: |
| 13 |
RUSTFLAGS: -Dwarnings |
| 14 |
|
| 15 |
jobs: |
| 16 |
pre_ci: |
| 17 |
uses: dtolnay/.github/.github/workflows/pre_ci.yml@master |
| 18 |
|
| 19 |
test: |
| 20 |
name: Rust ${{matrix.rust}} |
| 21 |
needs: pre_ci |
| 22 |
if: needs.pre_ci.outputs.continue |
| 23 |
runs-on: ubuntu-latest |
| 24 |
strategy: |
| 25 |
fail-fast: false |
| 26 |
matrix: |
| 27 |
rust: [nightly, beta, stable, 1.60.0] |
| 28 |
timeout-minutes: 45 |
| 29 |
steps: |
| 30 |
- uses: actions/checkout@v4 |
| 31 |
- uses: dtolnay/rust-toolchain@master |
| 32 |
with: |
| 33 |
toolchain: ${{matrix.rust}} |
| 34 |
- run: cargo check |
| 35 |
- run: cargo check --features verbatim |
| 36 |
- run: cargo test |
| 37 |
env: |
| 38 |
RUSTFLAGS: ${{env.RUSTFLAGS}} ${{matrix.rust == 'nightly' && '--cfg exhaustive' || ''}} |
| 39 |
|
| 40 |
examples: |
| 41 |
name: Examples |
| 42 |
needs: pre_ci |
| 43 |
if: needs.pre_ci.outputs.continue |
| 44 |
runs-on: ubuntu-latest |
| 45 |
timeout-minutes: 45 |
| 46 |
steps: |
| 47 |
- uses: actions/checkout@v4 |
| 48 |
- uses: dtolnay/rust-toolchain@nightly |
| 49 |
with: |
| 50 |
components: llvm-tools, rustc-dev, rustfmt |
| 51 |
- run: cargo run --manifest-path examples/update/Cargo.toml |
| 52 |
- run: git diff --exit-code |
| 53 |
- run: cargo run --manifest-path cargo-expand/update/Cargo.toml |
| 54 |
- run: git diff --exit-code |
| 55 |
|
| 56 |
fuzz: |
| 57 |
name: Fuzz |
| 58 |
needs: pre_ci |
| 59 |
if: needs.pre_ci.outputs.continue |
| 60 |
runs-on: ubuntu-latest |
| 61 |
timeout-minutes: 45 |
| 62 |
steps: |
| 63 |
- uses: actions/checkout@v4 |
| 64 |
- uses: dtolnay/rust-toolchain@nightly |
| 65 |
- uses: dtolnay/install@cargo-fuzz |
| 66 |
- run: cargo fuzz check |
| 67 |
|
| 68 |
minimal: |
| 69 |
name: Minimal versions |
| 70 |
needs: pre_ci |
| 71 |
if: needs.pre_ci.outputs.continue |
| 72 |
runs-on: ubuntu-latest |
| 73 |
timeout-minutes: 45 |
| 74 |
steps: |
| 75 |
- uses: actions/checkout@v4 |
| 76 |
- uses: dtolnay/rust-toolchain@nightly |
| 77 |
- run: cargo generate-lockfile -Z minimal-versions |
| 78 |
- run: cargo check --locked |
| 79 |
|
| 80 |
doc: |
| 81 |
name: Documentation |
| 82 |
needs: pre_ci |
| 83 |
if: needs.pre_ci.outputs.continue |
| 84 |
runs-on: ubuntu-latest |
| 85 |
timeout-minutes: 45 |
| 86 |
env: |
| 87 |
RUSTDOCFLAGS: -Dwarnings |
| 88 |
steps: |
| 89 |
- uses: actions/checkout@v4 |
| 90 |
- uses: dtolnay/rust-toolchain@nightly |
| 91 |
- uses: dtolnay/install@cargo-docs-rs |
| 92 |
- run: cargo docs-rs |
| 93 |
|
| 94 |
clippy: |
| 95 |
name: Clippy |
| 96 |
runs-on: ubuntu-latest |
| 97 |
if: github.event_name != 'pull_request' |
| 98 |
timeout-minutes: 45 |
| 99 |
steps: |
| 100 |
- uses: actions/checkout@v4 |
| 101 |
- uses: dtolnay/rust-toolchain@clippy |
| 102 |
- run: cargo clippy --features verbatim -- -Dclippy::all -Dclippy::pedantic |
| 103 |
|
| 104 |
outdated: |
| 105 |
name: Outdated |
| 106 |
runs-on: ubuntu-latest |
| 107 |
if: github.event_name != 'pull_request' |
| 108 |
timeout-minutes: 45 |
| 109 |
steps: |
| 110 |
- uses: actions/checkout@v4 |
| 111 |
- uses: dtolnay/rust-toolchain@stable |
| 112 |
- uses: dtolnay/install@cargo-outdated |
| 113 |
- run: cargo outdated --workspace --exit-code 1 |