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 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.56.0] 28 timeout-minutes: 45 29 steps: 30 - uses: actions/checkout@v3 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@v3 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@v3 64 - uses: dtolnay/rust-toolchain@nightly 65 - uses: dtolnay/install@cargo-fuzz 66 - run: cargo fuzz check 67 68 clippy: 69 name: Clippy 70 runs-on: ubuntu-latest 71 if: github.event_name != 'pull_request' 72 timeout-minutes: 45 73 steps: 74 - uses: actions/checkout@v3 75 - uses: dtolnay/rust-toolchain@clippy 76 - run: cargo clippy --features verbatim -- -Dclippy::all -Dclippy::pedantic 77 78 outdated: 79 name: Outdated 80 runs-on: ubuntu-latest 81 if: github.event_name != 'pull_request' 82 timeout-minutes: 45 83 steps: 84 - uses: actions/checkout@v3 85 - uses: dtolnay/install@cargo-outdated 86 - run: cargo outdated --workspace --exit-code 1 87