Debian Codegraph @

debian/missing-sources/either/.github/workflows/ci.yml

raw symbols SCIP
1 on:
2 push:
3 branches: [ main ]
4 pull_request:
5 merge_group:
6
7 name: CI
8
9 jobs:
10 ci:
11 runs-on: ubuntu-latest
12 strategy:
13 fail-fast: false
14 matrix:
15 rust:
16 - 1.63.0 # MSRV
17 - stable
18 - beta
19 - nightly
20 features:
21 - ""
22 - "serde"
23
24 steps:
25 - name: Checkout
26 uses: actions/checkout@v4
27
28 - name: Cache the registry
29 uses: actions/cache@v4
30 if: startsWith(matrix.rust, '1')
31 with:
32 path: ~/.cargo/registry/index
33 key: cargo-${{ matrix.rust }}-git-index
34
35 - name: Set up Rust
36 uses: dtolnay/rust-toolchain@master
37 with:
38 toolchain: ${{ matrix.rust }}
39
40 - name: Build (no_std)
41 run: cargo build --no-default-features --features "${{ matrix.features }}"
42
43 - name: Build
44 run: cargo build --features "${{ matrix.features }}"
45
46 - name: Test
47 run: cargo test --features "${{ matrix.features }}"
48
49 - name: Doc
50 run: cargo doc --features "${{ matrix.features }}"
51
52 clippy:
53 name: Rustfmt and Clippy
54 runs-on: ubuntu-latest
55 steps:
56 - name: Checkout
57 uses: actions/checkout@v4
58
59 - name: Set up nightly Rust
60 uses: dtolnay/rust-toolchain@nightly
61 with:
62 components: rustfmt, clippy
63
64 - name: Rustfmt
65 run: cargo fmt --all -- --check
66
67 - name: Clippy
68 run: cargo clippy # -- -D warnings
69
70 # One job that "summarizes" the success state of this pipeline. This can then be added to branch
71 # protection, rather than having to add each job separately.
72 success:
73 name: Success
74 runs-on: ubuntu-latest
75 needs: [ci, clippy]
76 # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
77 # failed" as success. So we have to do some contortions to ensure the job fails if any of its
78 # dependencies fails.
79 if: always() # make sure this is never "skipped"
80 steps:
81 # Manually check the status of all dependencies. `if: failure()` does not work.
82 - name: check if any dependency failed
83 run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'