1
1
name : CI
2
2
env :
3
3
CI : true
4
+ permissions : read-all
4
5
on :
5
6
pull_request :
6
7
push :
@@ -29,40 +30,51 @@ jobs:
29
30
runs-on : ${{ matrix.os }}
30
31
continue-on-error : ${{ matrix.rust == 'beta' }}
31
32
steps :
33
+ - name : Harden the runner (Audit all outbound calls)
34
+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
35
+ with :
36
+ egress-policy : audit
37
+
32
38
- name : Free disk space
33
39
if : ${{ matrix.os == 'ubuntu-latest'}}
34
40
run : |
35
41
df -h
36
42
sudo rm -rf /usr/local/lib/android
37
43
sudo rm -rf /usr/share/dotnet
38
44
df -h
39
- - uses : actions/checkout@v4
45
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40
46
with :
41
47
submodules : true
42
- - uses : dtolnay/rust-toolchain@master
48
+ - uses : dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
43
49
with :
44
50
toolchain : ${{ matrix.rust }}
45
51
components : rustfmt
46
52
- name : " Set rustup profile"
47
53
run : rustup set profile minimal
48
- - uses : arduino/setup-protoc@v3
54
+ - uses : arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
49
55
with :
50
56
repo-token : ${{ secrets.GITHUB_TOKEN }}
51
57
- name : Test
52
58
run : bash ./scripts/test.sh
53
59
lint :
54
60
runs-on : ubuntu-latest
55
61
steps :
56
- - uses : actions/checkout@v4
62
+ - name : Harden the runner (Audit all outbound calls)
63
+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
64
+ with :
65
+ egress-policy : audit
66
+
67
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
57
68
with :
58
69
submodules : true
59
- - uses : dtolnay/rust-toolchain@stable
70
+ - uses : dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4
60
71
with :
72
+ toolchain : stable
61
73
components : rustfmt, clippy
62
- - uses : taiki-e/install-action@v2
74
+ - uses : taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc # v2.49.45
63
75
with :
64
76
tool : cargo-hack
65
- - uses : arduino/setup-protoc@v3
77
+ - uses : arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
66
78
with :
67
79
repo-token : ${{ secrets.GITHUB_TOKEN }}
68
80
- name : Format
75
87
example : [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin]
76
88
runs-on : ubuntu-latest # TODO: Check if this could be covered for Windows. The step used currently fails on Windows.
77
89
steps :
78
- - uses : actions/checkout@v4
79
- - uses : dtolnay/rust-toolchain@nightly
90
+ - name : Harden the runner (Audit all outbound calls)
91
+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
92
+ with :
93
+ egress-policy : audit
94
+
95
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
96
+ - uses : dtolnay/rust-toolchain@a02741459ec5e501b9843ed30b535ca0a0376ae4
80
97
with :
81
98
toolchain : nightly-2024-06-30
82
99
components : rustfmt
@@ -93,11 +110,16 @@ jobs:
93
110
runs-on : ${{ matrix.os }}
94
111
continue-on-error : true
95
112
steps :
96
- - uses : actions/checkout@v4
113
+ - name : Harden the runner (Audit all outbound calls)
114
+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
115
+ with :
116
+ egress-policy : audit
117
+
118
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
97
119
with :
98
120
submodules : true
99
121
- name : Set up Rust ${{ matrix.rust }}
100
- uses : dtolnay/rust-toolchain@master
122
+ uses : dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
101
123
with :
102
124
toolchain : ${{ matrix.rust }}
103
125
- name : Patch dependencies versions
@@ -108,19 +130,30 @@ jobs:
108
130
runs-on : ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux
109
131
continue-on-error : true # Prevent sudden announcement of a new advisory from failing ci
110
132
steps :
111
- - uses : actions/checkout@v4
112
- - uses : EmbarkStudios/cargo-deny-action@v2
133
+ - name : Harden the runner (Audit all outbound calls)
134
+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
135
+ with :
136
+ egress-policy : audit
137
+
138
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
139
+ - uses : EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
113
140
with :
114
141
command : check advisories
115
142
docs :
116
143
continue-on-error : true
117
144
runs-on : ubuntu-latest
118
145
steps :
119
- - uses : actions/checkout@v4
120
- - uses : dtolnay/rust-toolchain@stable
146
+ - name : Harden the runner (Audit all outbound calls)
147
+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
121
148
with :
149
+ egress-policy : audit
150
+
151
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
152
+ - uses : dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4
153
+ with :
154
+ toolchain : stable
122
155
components : rustfmt
123
- - uses : arduino/setup-protoc@v3
156
+ - uses : arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
124
157
with :
125
158
repo-token : ${{ secrets.GITHUB_TOKEN }}
126
159
- name : doc
@@ -133,25 +166,30 @@ jobs:
133
166
runs-on : ubuntu-latest
134
167
if : ${{ ! contains(github.event.pull_request.labels.*.name, 'dependencies') }}
135
168
steps :
136
- - uses : actions/checkout@v4
169
+ - name : Harden the runner (Audit all outbound calls)
170
+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
171
+ with :
172
+ egress-policy : audit
173
+
174
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
137
175
with :
138
176
submodules : true
139
- - uses : dtolnay/rust-toolchain@stable
177
+ - uses : dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4
140
178
with :
141
179
toolchain : stable
142
180
components : rustfmt,llvm-tools-preview
143
- - uses : arduino/setup-protoc@v3
181
+ - uses : arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
144
182
with :
145
183
repo-token : ${{ secrets.GITHUB_TOKEN }}
146
184
- name : cargo install cargo-llvm-cov
147
- uses : taiki-e/install-action@cargo-llvm-cov
185
+ uses : taiki-e/install-action@5075451c95db43b063f20f0c8fef04c04d5bf0ba # cargo-llvm-cov
148
186
- name : cargo generate-lockfile
149
187
if : hashFiles('Cargo.lock') == ''
150
188
run : cargo generate-lockfile
151
189
- name : cargo llvm-cov
152
190
run : cargo llvm-cov --locked --all-features --workspace --lcov --lib --output-path lcov.info
153
191
- name : Upload to codecov.io
154
- uses : codecov/codecov-action@v4
192
+ uses : codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
155
193
env :
156
194
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
157
195
with :
@@ -160,13 +198,18 @@ jobs:
160
198
continue-on-error : true
161
199
runs-on : ubuntu-latest
162
200
steps :
163
- - uses : actions/checkout@v4
201
+ - name : Harden the runner (Audit all outbound calls)
202
+ uses : step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
203
+ with :
204
+ egress-policy : audit
205
+
206
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
164
207
with :
165
208
submodules : true
166
- - uses : dtolnay/rust-toolchain@master
209
+ - uses : dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
167
210
with :
168
211
toolchain : stable
169
- - uses : taiki-e/install-action@v2
212
+ - uses : taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc # v2.49.45
170
213
with :
171
214
tool : cargo-machete
172
215
- name : cargo machete
0 commit comments