11name : CI
22env :
33 CI : true
4+ permissions :
5+ contents : read
46on :
57 pull_request :
68 push :
@@ -29,43 +31,55 @@ jobs:
2931 runs-on : ${{ matrix.os }}
3032 continue-on-error : ${{ matrix.rust == 'beta' }}
3133 steps :
34+ - name : Harden the runner (Audit all outbound calls)
35+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
36+ with :
37+ egress-policy : audit
38+
3239 - name : Free disk space
3340 if : ${{ matrix.os == 'ubuntu-latest'}}
3441 run : |
3542 df -h
3643 sudo rm -rf /usr/local/lib/android
3744 sudo rm -rf /usr/share/dotnet
3845 df -h
39- - uses : actions/checkout@v4
46+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4047 with :
4148 submodules : true
42- - uses : dtolnay/rust-toolchain@master
49+ - uses : dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
4350 with :
4451 toolchain : ${{ matrix.rust }}
4552 components : rustfmt
4653 - name : " Set rustup profile"
4754 run : rustup set profile minimal
48- - uses : arduino/setup-protoc@v3
55+ - uses : arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
4956 with :
5057 repo-token : ${{ secrets.GITHUB_TOKEN }}
5158 - name : Test
5259 run : bash ./scripts/test.sh
5360 lint :
5461 runs-on : ubuntu-latest
5562 steps :
56- - uses : actions/checkout@v4
63+ - name : Harden the runner (Audit all outbound calls)
64+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
65+ with :
66+ egress-policy : audit
67+
68+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5769 with :
5870 submodules : true
59- - uses : dtolnay/rust-toolchain@stable
71+ - uses : dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4
6072 with :
61- components : rustfmt
62- - uses : arduino/setup-protoc@v3
73+ toolchain : stable
74+ components : rustfmt, clippy
75+ - uses : taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc # v2.49.45
6376 with :
64- repo-token : ${{ secrets.GITHUB_TOKEN }}
65- - uses : actions-rs/cargo@v1
77+ tool : cargo-hack
78+ - uses : arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
6679 with :
67- command : fmt
68- args : --all -- --check
80+ repo-token : ${{ secrets.GITHUB_TOKEN }}
81+ - name : Format
82+ run : cargo fmt --all -- --check
6983 - name : Lint
7084 run : bash ./scripts/lint.sh
7185 external-types :
7488 example : [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin]
7589 runs-on : ubuntu-latest # TODO: Check if this could be covered for Windows. The step used currently fails on Windows.
7690 steps :
77- - uses : actions/checkout@v4
78- - uses : dtolnay/rust-toolchain@nightly
91+ - name : Harden the runner (Audit all outbound calls)
92+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
93+ with :
94+ egress-policy : audit
95+
96+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
97+ - uses : dtolnay/rust-toolchain@a02741459ec5e501b9843ed30b535ca0a0376ae4
7998 with :
8099 toolchain : nightly-2024-06-30
81100 components : rustfmt
@@ -92,11 +111,16 @@ jobs:
92111 runs-on : ${{ matrix.os }}
93112 continue-on-error : true
94113 steps :
95- - uses : actions/checkout@v4
114+ - name : Harden the runner (Audit all outbound calls)
115+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
116+ with :
117+ egress-policy : audit
118+
119+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
96120 with :
97121 submodules : true
98122 - name : Set up Rust ${{ matrix.rust }}
99- uses : dtolnay/rust-toolchain@master
123+ uses : dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
100124 with :
101125 toolchain : ${{ matrix.rust }}
102126 - name : Patch dependencies versions
@@ -107,19 +131,48 @@ jobs:
107131 runs-on : ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux
108132 continue-on-error : true # Prevent sudden announcement of a new advisory from failing ci
109133 steps :
110- - uses : actions/checkout@v4
111- - uses : EmbarkStudios/cargo-deny-action@v1
134+ - name : Harden the runner (Audit all outbound calls)
135+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
136+ with :
137+ egress-policy : audit
138+
139+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
140+
141+ - name : Check advisories
142+ uses : EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
112143 with :
113144 command : check advisories
145+
146+ - name : Check licenses
147+ uses : EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
148+ with :
149+ command : check licenses
150+
151+ - name : Check bans
152+ uses : EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
153+ with :
154+ command : check bans
155+
156+ - name : Check sources
157+ uses : EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
158+ with :
159+ command : check sources
160+
114161 docs :
115162 continue-on-error : true
116163 runs-on : ubuntu-latest
117164 steps :
118- - uses : actions/checkout@v4
119- - uses : dtolnay/rust-toolchain@stable
165+ - name : Harden the runner (Audit all outbound calls)
166+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
167+ with :
168+ egress-policy : audit
169+
170+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
171+ - uses : dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4
120172 with :
173+ toolchain : stable
121174 components : rustfmt
122- - uses : arduino/setup-protoc@v3
175+ - uses : arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
123176 with :
124177 repo-token : ${{ secrets.GITHUB_TOKEN }}
125178 - name : doc
@@ -132,26 +185,51 @@ jobs:
132185 runs-on : ubuntu-latest
133186 if : ${{ ! contains(github.event.pull_request.labels.*.name, 'dependencies') }}
134187 steps :
135- - uses : actions/checkout@v4
188+ - name : Harden the runner (Audit all outbound calls)
189+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
190+ with :
191+ egress-policy : audit
192+
193+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
136194 with :
137195 submodules : true
138- - uses : dtolnay/rust-toolchain@stable
196+ - uses : dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4
139197 with :
140198 toolchain : stable
141199 components : rustfmt,llvm-tools-preview
142- - uses : arduino/setup-protoc@v3
200+ - uses : arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
143201 with :
144202 repo-token : ${{ secrets.GITHUB_TOKEN }}
145203 - name : cargo install cargo-llvm-cov
146- uses : taiki-e/install-action@cargo-llvm-cov
204+ uses : taiki-e/install-action@5075451c95db43b063f20f0c8fef04c04d5bf0ba # cargo-llvm-cov
147205 - name : cargo generate-lockfile
148206 if : hashFiles('Cargo.lock') == ''
149207 run : cargo generate-lockfile
150208 - name : cargo llvm-cov
151209 run : cargo llvm-cov --locked --all-features --workspace --lcov --lib --output-path lcov.info
152210 - name : Upload to codecov.io
153- uses : codecov/codecov-action@v4
211+ uses : codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
154212 env :
155213 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
156214 with :
157215 fail_ci_if_error : true
216+ cargo-machete :
217+ continue-on-error : true
218+ runs-on : ubuntu-latest
219+ steps :
220+ - name : Harden the runner (Audit all outbound calls)
221+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
222+ with :
223+ egress-policy : audit
224+
225+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
226+ with :
227+ submodules : true
228+ - uses : dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
229+ with :
230+ toolchain : stable
231+ - uses : taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc # v2.49.45
232+ with :
233+ tool : cargo-machete
234+ - name : cargo machete
235+ run : cargo machete
0 commit comments