Files
CST-agent/scripts/ci_checkout.sh
T
WHC d6ae1a67c4 ci: drop macOS, skip ASan, checkout without GitHub, MinGW zip
- Replace actions/checkout (pulls from github.com) with scripts/ci_checkout.sh
  fetched from this Gitea over raw/commit.
- Remove the macOS job (no runner).
- Disable sanitizers until the Docker runner has SYS_PTRACE; it was wedging
  the only slot with AddressSanitizer:DEADLYSIGNAL.
- Add windows-cross: Nix UCRT mingw via TUNA, bootstrap_windows.sh, verify
  dist/cst-agent-*-windows-x86_64.zip. Third-party git clones go through
  gitclone.com.
2026-10-07 02:21:18 +08:00

34 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Checkout this repo without downloading actions/checkout from GitHub.
# act_runner may already have placed sources in the workspace; otherwise
# clone from the same Gitea that started the job.
set -euo pipefail
SERVER="${GITHUB_SERVER_URL:-${GITEA_SERVER_URL:-}}"
REPO="${GITHUB_REPOSITORY:-${GITEA_REPOSITORY:-}}"
SHA="${GITHUB_SHA:-${GITEA_SHA:-}}"
if [[ -f CMakeLists.txt && -d src ]]; then
echo "==> workspace already has sources"
git rev-parse --short HEAD 2>/dev/null || true
exit 0
fi
if [[ -z "$SERVER" || -z "$REPO" ]]; then
echo "missing GITHUB_SERVER_URL / GITHUB_REPOSITORY" >&2
exit 1
fi
echo "==> git clone $SERVER/$REPO"
git clone --filter=blob:none "$SERVER/$REPO.git" _ci_src
if [[ -n "$SHA" ]]; then
git -C _ci_src fetch --depth 1 origin "$SHA" || git -C _ci_src fetch origin "$SHA"
git -C _ci_src checkout --force "$SHA"
fi
# Move into the workspace root (may already contain act_runner metadata).
shopt -s dotglob nullglob
mv _ci_src/* .
rmdir _ci_src 2>/dev/null || rm -rf _ci_src
test -f CMakeLists.txt
git rev-parse --short HEAD