Skip to content

Commit 2f370f0

Browse files
authored
ci: make persistent test vectors (#395)
1 parent bafbbd7 commit 2f370f0

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/build-common.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ jobs:
3636
sudo dnf install -y systemd-devel
3737
./deps.sh
3838
39+
- name: check out test-vectors (persistent)
40+
run: |
41+
COMMIT_SHA=$(cat scripts/test-vectors-commit-sha.txt)
42+
TEST_VECTORS_PATH="/data/svc_firedancer/test-vectors/${COMMIT_SHA}"
43+
if [[ ! -d "${TEST_VECTORS_PATH}" ]]; then
44+
mkdir -p /data/svc_firedancer/test-vectors
45+
git clone https://github.com/firedancer-io/test-vectors.git "${TEST_VECTORS_PATH}"
46+
git -C "${TEST_VECTORS_PATH}" checkout "${COMMIT_SHA}"
47+
fi
48+
mkdir -p dump
49+
ln -sf "${TEST_VECTORS_PATH}" dump/test-vectors
50+
3951
- name: Check lints and clippy
4052
run: |
4153
cargo fmt --all -- --check

scripts/run_test_vectors.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,16 @@ echo "Using test-vectors commit: $GIT_REF"
2828
# Fetch/update test-vectors repo
2929
if [ ! -d dump/test-vectors ]; then
3030
echo "Cloning test-vectors repository..."
31-
(cd dump && git clone --depth=1 -q https://github.com/firedancer-io/test-vectors.git)
32-
else
33-
echo "Updating test-vectors repository..."
34-
(cd dump/test-vectors && git fetch -q origin "$GIT_REF" || true)
31+
(cd dump && git clone --depth=1 -q --no-tags https://github.com/firedancer-io/test-vectors.git)
3532
fi
3633

3734
# Checkout specific commit non-destructively
3835
(
3936
cd dump/test-vectors
40-
if ! git cat-file -e "$GIT_REF"^{commit} 2>/dev/null; then
41-
echo "Fetching test vectors commit $GIT_REF..."
42-
git fetch -q origin "$GIT_REF"
37+
if ! git checkout -q $GIT_REF; then
38+
git remote update
39+
git checkout -q $GIT_REF
4340
fi
44-
git checkout -q --detach "$GIT_REF"
4541
)
4642

4743
# Show the commit hashes being used

0 commit comments

Comments
 (0)