Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# S3 storage for the blob tests: RustFS, as the visual-capture job uses.
- run: |
image=ghcr.io/docspring/visualci/mirror/rustfs:1.0.6@sha256:0dff1515b3c52b5ce8c5df2263420c7f93ae1c5d07cca79e19e57cff86b84c85
scripts/ci/pull.sh "$image"
docker run -d --name s3 -p 59000:9000 \
-e RUSTFS_ACCESS_KEY=visualci -e RUSTFS_SECRET_KEY=visualci-dev-secret "$image"
for _ in $(seq 1 30); do curl -s -o /dev/null http://127.0.0.1:59000/ && break; sleep 1; done
- run: scripts/ci/s3.sh
# Trial (c) on this job: rust-cache restores target/ (incremental state and our own crates), with kache behind
# it for dependency misses. Its key covers Cargo.lock and the toolchain; only main saves it, like kache.
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
Expand Down Expand Up @@ -259,12 +254,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
# S3 storage for the seeded blobs: RustFS (Apache-2.0), since MinIO's images are no longer public. A step rather
# than a service, so the job doesn't wait on a health check the image doesn't define.
- run: |
image=ghcr.io/docspring/visualci/mirror/rustfs:1.0.6@sha256:0dff1515b3c52b5ce8c5df2263420c7f93ae1c5d07cca79e19e57cff86b84c85
scripts/ci/pull.sh "$image"
docker run -d --name s3 -p 59000:9000 \
-e RUSTFS_ACCESS_KEY=visualci -e RUSTFS_SECRET_KEY=visualci-dev-secret "$image"
for _ in $(seq 1 30); do curl -s -o /dev/null http://127.0.0.1:59000/ && break; sleep 1; done
- run: scripts/ci/s3.sh
# Compile cache (kache, as Cargo's rustc wrapper): the R2 bucket every machine shares (KACHE_BUCKET), else the
# GitHub Actions cache. Only main writes it: the read-write key is a secret of the kache-write environment,
# which only main may use, so a pull request (whatever its ci.yml says) gets the read-only key.
Expand Down Expand Up @@ -418,12 +408,7 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: |
image=ghcr.io/docspring/visualci/mirror/rustfs:1.0.6@sha256:0dff1515b3c52b5ce8c5df2263420c7f93ae1c5d07cca79e19e57cff86b84c85
scripts/ci/pull.sh "$image"
docker run -d --name s3 -p 59000:9000 \
-e RUSTFS_ACCESS_KEY=visualci -e RUSTFS_SECRET_KEY=visualci-dev-secret "$image"
for _ in $(seq 1 30); do curl -s -o /dev/null http://127.0.0.1:59000/ && break; sleep 1; done
- run: scripts/ci/s3.sh
- uses: kunobi-ninja/kache-action@061011817fd04b0e460f79d6bb3c115b1fc8f029 # v1
with:
version: "2.4.0"
Expand Down
20 changes: 20 additions & 0 deletions scripts/ci/s3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Starts RustFS for a CI job's blob store on a free host port, and points the job's later steps at it
# (VISUALCI_S3_ENDPOINT for scripts/ci/visual.sh and scripts/journeys/run.sh, VISUALCI_APP_TEST_S3_ENDPOINT for app's
# tests). Never a fixed port: a runner can keep an earlier job's container, and two jobs can share a host (5 Dec 2026,
# run 47533443138: "port 59000 ... address already in use"). Log in to ghcr.io first.
set -euo pipefail
image=ghcr.io/docspring/visualci/mirror/rustfs:1.0.6@sha256:0dff1515b3c52b5ce8c5df2263420c7f93ae1c5d07cca79e19e57cff86b84c85
"$(dirname "$0")/pull.sh" "$image"
name="s3-${GITHUB_RUN_ID:-local}-${GITHUB_RUN_ATTEMPT:-1}-${GITHUB_JOB:-job}"
docker rm -f "$name" >/dev/null 2>&1 || true
docker run -d --rm --name "$name" -p 127.0.0.1::9000 \
-e RUSTFS_ACCESS_KEY=visualci -e RUSTFS_SECRET_KEY=visualci-dev-secret "$image" >/dev/null
port=$(docker port "$name" 9000/tcp | head -1 | sed 's/.*://')
endpoint="http://127.0.0.1:$port"
for _ in $(seq 1 30); do curl -s -o /dev/null "$endpoint/" && break; sleep 1; done
curl -s -o /dev/null "$endpoint/" || { echo "::error::RustFS didn't answer on $endpoint"; docker logs "$name" | tail -20; exit 1; }
echo "RustFS ($name) on $endpoint"
if [ -n "${GITHUB_ENV:-}" ]; then
{ echo "VISUALCI_S3_ENDPOINT=$endpoint"; echo "VISUALCI_APP_TEST_S3_ENDPOINT=$endpoint"; } >>"$GITHUB_ENV"
fi
Loading