Skip to content

Commit e74de84

Browse files
committed
Auto merge of #2058 - jtgeibel:ci/gh-actions-updates, r=jtgeibel
CI: Add docs to GH Actions workflow and add `RUST_BACKTRACE=1` Our caching situation on GH Actions could use some work. For now, I've added documentation with some initial thoughts. This also adds `RUST_BACKTRACE=1` to help us debug random test failures on GH Actions: `panicked at 'Could not run jobs: NoMessageReceived'`. r? @carols10cents
2 parents 6ebd232 + c028bd3 commit e74de84

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
PERCY_PROJECT: crates-io/crates.io
2323

2424
steps:
25-
- uses: actions/checkout@v2-beta
25+
- uses: actions/checkout@v2
2626

2727
- uses: actions/cache@v1
2828
with:
@@ -63,14 +63,15 @@ jobs:
6363
- nightly
6464

6565
env:
66+
RUST_BACKTRACE: 1
6667
DATABASE_URL: postgres://postgres:@localhost/cargo_registry_test
6768
TEST_DATABASE_URL: postgres://postgres:@localhost/cargo_registry_test
6869
CARGO_INCREMENTAL: 0
6970
RUSTFLAGS: "-C debuginfo=0 -D warnings"
7071
MALLOC_CONF: "background_thread:true,abort_conf:true,abort:true,junk:true"
7172

7273
steps:
73-
- uses: actions/checkout@v2-beta
74+
- uses: actions/checkout@v2
7475

7576
- name: Cleanup pre-installed Rust toolchains
7677
# The pre-installed toolchain is under root permission, and this would
@@ -85,6 +86,18 @@ jobs:
8586
fi
8687
echo "::add-path::$HOME/.cargo/bin"
8788
89+
# FIXME: Nightly and beta channels have high churn. The cache quickly expires, but there is
90+
# no way (that I can find) to overwrite an existing cache. There is also no way to
91+
# dynamically include the latest version number for a release channel into the cache `key`
92+
# value. Once a cached release becomes stale, every job will begin downloading the latest
93+
# release from upstream and the cache becomes useless for that channel.
94+
#
95+
# Including `hashFiles('**/Cargo.lock')` below is a hack. Ideally, we would change the `key`
96+
# for each channel at the same rate as the release cadence for that channel. For the stable
97+
# channel this is too frequent and for the nightly channel (and probably beta as well) it is
98+
# not often enough.
99+
#
100+
# Current size as of 2019-12-23: ~123 MB
88101
- name: Cache rustup
89102
uses: actions/cache@v1
90103
with:
@@ -94,6 +107,10 @@ jobs:
94107
${{ runner.os }}-rustup-${{ matrix.rust }}-
95108
${{ runner.os }}-rustup-
96109
110+
# This step has the same tradeoffs as `Cache rustup`, however the cache size is significantly
111+
# smaller. The installed `diesel` binary is also stored here.
112+
#
113+
# Current size as of 2019-12-23: ~6 MB
97114
- name: Cache cargo binaries
98115
uses: actions/cache@v1
99116
with:
@@ -103,6 +120,7 @@ jobs:
103120
${{ runner.os }}-cargo-bin-${{ matrix.rust }}-
104121
${{ runner.os }}-cargo-bin-
105122
123+
# Current size as of 2019-12-23: ~77 MB
106124
- name: Cache cargo registry cache
107125
uses: actions/cache@v1
108126
with:
@@ -112,6 +130,7 @@ jobs:
112130
${{ runner.os }}-cargo-registry-cache-${{ matrix.rust }}-
113131
${{ runner.os }}-cargo-registry-cache-
114132
133+
# Current size as of 2019-12-23: ~38 MB
115134
- name: Cache cargo registry index
116135
uses: actions/cache@v1
117136
with:
@@ -121,6 +140,7 @@ jobs:
121140
${{ runner.os }}-cargo-registry-index-${{ matrix.rust }}-
122141
${{ runner.os }}-cargo-registry-index-
123142
143+
# Current size as of 2019-12-23: ~4 MB
124144
- name: Cache cargo git db
125145
uses: actions/cache@v1
126146
with:
@@ -130,6 +150,7 @@ jobs:
130150
${{ runner.os }}-cargo-git-db-${{ matrix.rust }}-
131151
${{ runner.os }}-cargo-git-db-
132152
153+
# Current size as of 2019-12-23: ~336 MB
133154
- name: Cache cargo build
134155
uses: actions/cache@v1
135156
with:

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ before_cache: script/ci/prune-cache.sh
1616

1717
env:
1818
global:
19+
- RUST_BACKTRACE=1
1920
- JOBS=1 # See https://git.io/vdao3 for details.
2021
- DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
2122
- TEST_DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test

0 commit comments

Comments
 (0)