Skip to content

Commit 60a2644

Browse files
committed
chore: add CI env variable configurations (#1672)
This branch adds some environment variables to configure *all* CI jobs. In particular, we: - disable incremental compilation - increase the number of retries for network requests in `cargo` and `rustup` - emit shortened backtraces from panics This config was blatantly stolen from linkerd/linkerd2-proxy#7137. :) Incremental compilation is useful as part of an edit-build-test-edit cycle, as it lets the compiler avoid recompiling code that hasn't changed. However, on CI, we're not making small edits; we're almost always building the entire project from scratch. Thus, incremental compilation on CI actually introduces *additional* overhead to support making future builds faster...but no future builds will ever occur in any given CI environment. See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow for details. Increasing retries for network requests should help reduce flakiness a bit.
1 parent ffdce75 commit 60a2644

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

Diff for: .github/workflows/CI.yml

+21
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ on:
66
- master
77
pull_request: {}
88

9+
env:
10+
# Disable incremental compilation.
11+
#
12+
# Incremental compilation is useful as part of an edit-build-test-edit cycle,
13+
# as it lets the compiler avoid recompiling code that hasn't changed. However,
14+
# on CI, we're not making small edits; we're almost always building the entire
15+
# project from scratch. Thus, incremental compilation on CI actually
16+
# introduces *additional* overhead to support making future builds
17+
# faster...but no future builds will ever occur in any given CI environment.
18+
#
19+
# See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
20+
# for details.
21+
CARGO_INCREMENTAL: 0
22+
# Allow more retries for network requests in cargo (downloading crates) and
23+
# rustup (installing toolchains). This should help to reduce flaky CI failures
24+
# from transient network timeouts or other issues.
25+
CARGO_NET_RETRY: 10
26+
RUSTUP_MAX_RETRIES: 10
27+
# Don't emit giant backtraces in the CI logs.
28+
RUST_BACKTRACE: short
29+
930
jobs:
1031
check-msrv:
1132
# Run `cargo check` on our minimum supported Rust version (1.42.0).

Diff for: .github/workflows/audit.yml

+23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
11
name: Security audit
2+
23
on:
34
schedule:
45
- cron: '0 0 * * *'
6+
7+
env:
8+
# Disable incremental compilation.
9+
#
10+
# Incremental compilation is useful as part of an edit-build-test-edit cycle,
11+
# as it lets the compiler avoid recompiling code that hasn't changed. However,
12+
# on CI, we're not making small edits; we're almost always building the entire
13+
# project from scratch. Thus, incremental compilation on CI actually
14+
# introduces *additional* overhead to support making future builds
15+
# faster...but no future builds will ever occur in any given CI environment.
16+
#
17+
# See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
18+
# for details.
19+
CARGO_INCREMENTAL: 0
20+
# Allow more retries for network requests in cargo (downloading crates) and
21+
# rustup (installing toolchains). This should help to reduce flaky CI failures
22+
# from transient network timeouts or other issues.
23+
CARGO_NET_RETRY: 10
24+
RUSTUP_MAX_RETRIES: 10
25+
# Don't emit giant backtraces in the CI logs.
26+
RUST_BACKTRACE: short
27+
528
jobs:
629
security_audit:
730
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)