Skip to content

Commit b7392fd

Browse files
committed
ci: workflow improvements
1 parent c51a95e commit b7392fd

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.github/workflows/canary.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,17 +479,22 @@ jobs:
479479
# Strip build metadata for crates.io (e.g., 0.1.0-dev.20260201.123+abc1234 → 0.1.0-dev.20260201.123)
480480
CRATE_VERSION="${VERSION%+*}"
481481
482-
# Wait for a crate version to appear in the crates.io index.
483-
# Polls every 10s for up to 5 minutes before failing.
482+
# Wait for a crate version to appear in the crates.io sparse index.
483+
# Checks the sparse index directly (faster than cargo search).
484+
# Polls every 10s for up to 10 minutes before failing.
484485
wait_for_crate() {
485486
local crate="$1"
486487
local version="$2"
487-
local max_attempts=30
488+
local max_attempts=60
488489
local attempt=0
489490
491+
# Sparse index prefix: 4+ char names use first-two/next-two
492+
local prefix="${crate:0:2}/${crate:2:2}"
493+
local index_url="https://index.crates.io/${prefix}/${crate}"
494+
490495
echo "Waiting for ${crate}@${version} to be indexed on crates.io..."
491496
while [ $attempt -lt $max_attempts ]; do
492-
if cargo search "${crate}" --limit 1 2>/dev/null | grep -q "^${crate} = \"${version}\""; then
497+
if curl -sf "${index_url}" 2>/dev/null | grep -q "\"vers\":\"${version}\""; then
493498
echo "${crate}@${version} is now available"
494499
return 0
495500
fi

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
branches: [main]
88
pull_request:
99
branches: [main]
10-
schedule:
11-
# Nightly at midnight UTC (for coverage)
12-
- cron: "0 0 * * *"
1310

1411
# Cancel in-progress runs when new commits are pushed
1512
concurrency:
@@ -271,7 +268,6 @@ jobs:
271268
name: Coverage
272269
needs: test
273270
runs-on: ubuntu-latest
274-
if: github.event_name == 'schedule'
275271
continue-on-error: true
276272
env:
277273
RUSTFLAGS: "-C codegen-units=16 -C link-arg=-fuse-ld=mold"

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,17 +475,22 @@ jobs:
475475
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
476476
VERSION: ${{ needs.prepare.outputs.version }}
477477
run: |
478-
# Wait for a crate version to appear in the crates.io index.
479-
# Polls every 10s for up to 5 minutes before failing.
478+
# Wait for a crate version to appear in the crates.io sparse index.
479+
# Checks the sparse index directly (faster than cargo search).
480+
# Polls every 10s for up to 10 minutes before failing.
480481
wait_for_crate() {
481482
local crate="$1"
482483
local version="$2"
483-
local max_attempts=30
484+
local max_attempts=60
484485
local attempt=0
485486
487+
# Sparse index prefix: 4+ char names use first-two/next-two
488+
local prefix="${crate:0:2}/${crate:2:2}"
489+
local index_url="https://index.crates.io/${prefix}/${crate}"
490+
486491
echo "Waiting for ${crate}@${version} to be indexed on crates.io..."
487492
while [ $attempt -lt $max_attempts ]; do
488-
if cargo search "${crate}" --limit 1 2>/dev/null | grep -q "^${crate} = \"${version}\""; then
493+
if curl -sf "${index_url}" 2>/dev/null | grep -q "\"vers\":\"${version}\""; then
489494
echo "${crate}@${version} is now available"
490495
return 0
491496
fi

0 commit comments

Comments
 (0)