Skip to content

Commit 9307caa

Browse files
committed
Refactor TiDB version pre-download to use loop
Use a loop to pre-download all TiDB versions matching the test matrix. This makes it easier to maintain and ensures all test versions are pre-fetched in the prepare-dependencies job.
1 parent a265ff5 commit 9307caa

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,16 @@ jobs:
6363
- name: Pre-download TiDB versions
6464
run: |
6565
export PATH=$HOME/.tiup/bin:$PATH
66-
# Pre-download TiDB versions used in tests (only if not already cached)
67-
tiup install tidb:v6.1.0 || true
68-
tiup install tidb:v6.5.3 || true
69-
tiup install tidb:v7.1.5 || true
70-
tiup install tidb:v7.5.2 || true
71-
tiup install tidb:v8.1.0 || true
72-
# Also install PD and TiKV components
73-
tiup install pd:v6.1.0 || true
74-
tiup install pd:v6.5.3 || true
75-
tiup install pd:v7.1.5 || true
76-
tiup install pd:v7.5.2 || true
77-
tiup install pd:v8.1.0 || true
78-
tiup install tikv:v6.1.0 || true
79-
tiup install tikv:v6.5.3 || true
80-
tiup install tikv:v7.1.5 || true
81-
tiup install tikv:v7.5.2 || true
82-
tiup install tikv:v8.1.0 || true
66+
# Pre-download all TiDB versions used in test matrix
67+
# Versions: 6.1.0, 6.5.3, 7.1.5, 7.5.2, 8.1.0
68+
VERSIONS="6.1.0 6.5.3 7.1.5 7.5.2 8.1.0"
69+
for version in $VERSIONS; do
70+
echo "Pre-downloading TiDB components for v${version}..."
71+
tiup install tidb:v${version} || true
72+
tiup install pd:v${version} || true
73+
tiup install tikv:v${version} || true
74+
done
75+
echo "TiDB version pre-download complete"
8376
8477
- name: Upload Terraform binary
8578
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)