Skip to content

Commit 7914554

Browse files
committed
Auto merge of #9921 - ehuss:fetch-smoke, r=alexcrichton
Add fetch smoke test. This adds a test with a statically built curl to check if running `cargo fetch` works. This adds a few minutes to CI time, but I think it is worthwhile to try to catch some regressions. Note that macOS uses system curl to match the rust-lang/rust build mode.
2 parents f36ee65 + 90b2ef0 commit 7914554

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ jobs:
7979
if: matrix.os == 'macos-latest'
8080
- run: cargo build --manifest-path crates/credential/cargo-credential-wincred/Cargo.toml
8181
if: matrix.os == 'windows-latest'
82+
- name: Fetch smoke test
83+
run: ci/fetch-smoke-test.sh
8284

8385
resolver:
8486
runs-on: ubuntu-latest

ci/fetch-smoke-test.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
# This script builds with static curl, and verifies that fetching works.
3+
4+
set -ex
5+
6+
if [[ -z "$RUNNER_TEMP" ]]
7+
then
8+
echo "RUNNER_TEMP must be set"
9+
exit 1
10+
fi
11+
12+
if [ ! -f Cargo.toml ]; then
13+
echo "Must be run from root of project."
14+
exit 1
15+
fi
16+
17+
18+
# Building openssl on Windows is a pain.
19+
if [[ $(rustc -Vv | grep host:) != *windows* ]]; then
20+
FEATURES='vendored-openssl,curl-sys/static-curl,curl-sys/force-system-lib-on-osx'
21+
export LIBZ_SYS_STATIC=1
22+
fi
23+
24+
cargo build --features "$FEATURES"
25+
export CARGO_HOME=$RUNNER_TEMP/chome
26+
target/debug/cargo fetch
27+
rm -rf $CARGO_HOME

0 commit comments

Comments
 (0)