Debian Codegraph @

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

raw symbols SCIP
1 on:
2 push:
3 branches: [ main ]
4 pull_request:
5 branches: [ main ]
6 merge_group:
7
8 name: CI
9
10 env:
11 CARGO_TERM_COLOR: always
12 CARGO_INCREMENTAL: 0
13
14 jobs:
15 tests:
16 runs-on: ubuntu-latest
17 strategy:
18 matrix:
19 include:
20 - rust: 1.82.0 # MSRV
21 features:
22 - rust: stable
23 features: arbitrary
24 - rust: stable
25 features: quickcheck
26 - rust: stable
27 features: rayon
28 - rust: stable
29 features: serde
30 - rust: stable
31 features: sval
32 - rust: stable
33 features: borsh
34 - rust: stable
35 features: std
36 - rust: beta
37 features:
38 - rust: nightly
39 bench: test build benchmarks
40
41 steps:
42 - uses: actions/checkout@v4
43 - name: Lock MSRV-compatible dependencies
44 if: matrix.rust == '1.82.0'
45 env:
46 CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback
47 # Note that this uses the runner's pre-installed stable cargo
48 run: cargo generate-lockfile
49 - uses: dtolnay/rust-toolchain@master
50 with:
51 toolchain: ${{ matrix.rust }}
52 - name: Tests
53 run: |
54 cargo build --verbose --features "${{ matrix.features }}"
55 cargo doc --verbose --features "${{ matrix.features }}"
56 cargo test --verbose --features "${{ matrix.features }}"
57 cargo test --release --verbose --features "${{ matrix.features }}"
58 - name: Tests (serde)
59 if: matrix.features == 'serde'
60 run: |
61 cargo test --verbose -p test-serde
62 - name: Tests (sval)
63 if: matrix.features == 'sval'
64 run: |
65 cargo test --verbose -p test-sval
66 - name: Test run benchmarks
67 if: matrix.bench != ''
68 run: cargo test -v --benches
69
70 nostd_build:
71 runs-on: ubuntu-latest
72 strategy:
73 matrix:
74 include:
75 - rust: 1.82.0
76 target: thumbv6m-none-eabi
77 - rust: stable
78 target: thumbv6m-none-eabi
79
80 steps:
81 - uses: actions/checkout@v4
82 - name: Lock MSRV-compatible dependencies
83 if: matrix.rust == '1.82.0'
84 env:
85 CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback
86 # Note that this uses the runner's pre-installed stable cargo
87 run: cargo generate-lockfile
88 - uses: dtolnay/rust-toolchain@master
89 with:
90 toolchain: ${{ matrix.rust }}
91 target: ${{ matrix.target }}
92 - name: Tests
93 run: |
94 cargo build -vv --target=${{ matrix.target }} --no-default-features
95 cargo build -v -p test-nostd --target=${{ matrix.target }}
96
97 clippy:
98 runs-on: ubuntu-latest
99 steps:
100 - uses: actions/checkout@v4
101 - uses: dtolnay/rust-toolchain@beta
102 with:
103 components: clippy
104 - run: cargo clippy --all-features
105
106 miri:
107 runs-on: ubuntu-latest
108 steps:
109 - uses: actions/checkout@v4
110 - uses: dtolnay/rust-toolchain@nightly
111 with:
112 components: miri, rust-src
113 - uses: taiki-e/install-action@v2
114 with:
115 tool: cargo-nextest
116 if: github.event_name == 'merge_group'
117 - run: cargo miri nextest run
118 if: github.event_name == 'merge_group'
119 - run: cargo miri test --doc
120
121 minimal-versions:
122 name: Check MSRV and minimal-versions
123 runs-on: ubuntu-latest
124 steps:
125 - uses: actions/checkout@v4
126 - uses: dtolnay/rust-toolchain@nightly
127 - uses: dtolnay/[email protected] # MSRV
128 - uses: taiki-e/install-action@v2
129 with:
130 tool: cargo-hack
131 - name: Lock minimal direct dependencies
132 run: cargo +nightly hack generate-lockfile --remove-dev-deps -Z direct-minimal-versions
133 env:
134 CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback
135 - name: Build (nightly)
136 run: cargo +nightly build --verbose --all-features
137 - name: Build (MSRV)
138 run: cargo build --verbose --features arbitrary,quickcheck,serde,sval,rayon
139
140 # One job that "summarizes" the success state of this pipeline. This can then be added to branch
141 # protection, rather than having to add each job separately.
142 success:
143 name: Success
144 runs-on: ubuntu-latest
145 needs: [tests, nostd_build, clippy, miri, minimal-versions]
146 # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
147 # failed" as success. So we have to do some contortions to ensure the job fails if any of its
148 # dependencies fails.
149 if: always() # make sure this is never "skipped"
150 steps:
151 # Manually check the status of all dependencies. `if: failure()` does not work.
152 - name: check if any dependency failed
153 run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'