|
1 | | -name: Rust CI for WSLPlugins-rs |
2 | | - |
3 | 1 | on: |
4 | 2 | push: |
5 | 3 | branches: ["main"] |
6 | 4 | pull_request: |
7 | 5 | branches: ["main"] |
8 | 6 |
|
9 | | -env: |
10 | | - CARGO_TERM_COLOR: always |
11 | | - |
12 | 7 | jobs: |
13 | 8 | build-and-validate: |
14 | 9 | runs-on: windows-latest |
15 | | - |
16 | 10 | strategy: |
17 | 11 | matrix: |
18 | | - toolchain: ["stable", "nightly"] |
| 12 | + include: |
| 13 | + - toolchain: stable |
| 14 | + RUSTDOCFLAGS: "-D warnings" |
| 15 | + DOCTYPE: "docrs" |
| 16 | + - toolchain: nightly |
| 17 | + RUSTDOCFLAGS: "-D warnings --cfg docsrs" |
| 18 | + DOCTYPE: "doc" |
| 19 | + |
| 20 | + name: "Build and validate (${{ matrix.toolchain}})" |
| 21 | + env: |
| 22 | + CARGO_TERM_COLOR: always |
| 23 | + RUSTFLAGS: -D warnings |
| 24 | + RUSTDOCFLAGS: ${{ matrix.RUSTDOCFLAGS }} |
19 | 25 |
|
20 | 26 | steps: |
21 | 27 | - name: Checkout Code |
22 | 28 | uses: actions/checkout@v4 |
23 | 29 |
|
| 30 | + - name: Cache Cargo Registry |
| 31 | + uses: actions/cache@v3 |
| 32 | + with: |
| 33 | + path: ~/.cargo/registry |
| 34 | + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} |
| 35 | + restore-keys: ${{ runner.os }}-cargo-registry- |
| 36 | + |
| 37 | + - name: Cache Cargo Git Index |
| 38 | + uses: actions/cache@v3 |
| 39 | + with: |
| 40 | + path: ~/.cargo/git |
| 41 | + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} |
| 42 | + restore-keys: ${{ runner.os }}-cargo-index- |
| 43 | + |
24 | 44 | - name: Install Rust (Matrix) |
25 | 45 | shell: pwsh |
26 | 46 | run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} |
27 | 47 |
|
28 | 48 | - name: Lint with Clippy (Stable Only) |
29 | 49 | if: matrix.toolchain == 'stable' |
30 | | - run: cargo clippy --all-targets --all-features -- -D warnings |
| 50 | + run: cargo clippy --all-targets --all-features |
31 | 51 |
|
32 | 52 | - name: Check Code Formatting (Stable Only) |
33 | 53 | if: matrix.toolchain == 'stable' |
|
39 | 59 | - name: Run Tests |
40 | 60 | run: cargo test --verbose |
41 | 61 |
|
42 | | - - name: Generate Documentation (Stable Only) |
43 | | - if: matrix.toolchain == 'stable' |
44 | | - run: cargo doc --no-deps |
45 | | - |
46 | | - - name: Generate Documentation for Docs.rs (Nightly Only) |
47 | | - if: matrix.toolchain == 'nightly' |
48 | | - shell: pwsh |
49 | | - run: | |
50 | | - $env:RUSTDOCFLAGS = "--cfg docsrs" |
51 | | - cargo +nightly doc --no-deps |
| 62 | + - name: Generate Documentation (${{ matrix.RUSTDOCFLAGS }}, ${{ matrix.toolchain }}) |
| 63 | + run: cargo doc --no-deps --all-features |
52 | 64 |
|
53 | 65 | - name: Install and Run Security Audit (Nightly Only) |
54 | 66 | if: matrix.toolchain == 'nightly' |
|
0 commit comments