Skip to content

Commit 237943f

Browse files
committed
Add single source of truth for TiDB versions
Define TIDB_VERSIONS as workflow-level environment variable. Pre-download step now uses env.TIDB_VERSIONS instead of hardcoded list. Added comment in test matrix referencing the env var for maintainability. To add/remove TiDB versions, update env.TIDB_VERSIONS and the corresponding testtidb* entries in the matrix.
1 parent 9307caa commit 237943f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
tags: ["*"]
77
pull_request:
88
branches: [ "*" ]
9+
10+
# TiDB versions used in tests - single source of truth
11+
env:
12+
TIDB_VERSIONS: "6.1.0 6.5.3 7.1.5 7.5.2 8.1.0"
13+
914
jobs:
1015
lint:
1116
runs-on: ubuntu-22.04
@@ -63,10 +68,9 @@ jobs:
6368
- name: Pre-download TiDB versions
6469
run: |
6570
export PATH=$HOME/.tiup/bin:$PATH
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
71+
# Pre-download all TiDB versions from env.TIDB_VERSIONS (single source of truth)
72+
echo "Pre-downloading TiDB versions: ${{ env.TIDB_VERSIONS }}"
73+
for version in ${{ env.TIDB_VERSIONS }}; do
7074
echo "Pre-downloading TiDB components for v${version}..."
7175
tiup install tidb:v${version} || true
7276
tiup install pd:v${version} || true
@@ -105,6 +109,7 @@ jobs:
105109
- testmariadb10.8
106110
- testmariadb10.10
107111
# Track https://github.com/pingcap/tidb/tags
112+
# TiDB versions must match env.TIDB_VERSIONS: 6.1.0 6.5.3 7.1.5 7.5.2 8.1.0
108113
- testtidb6.1.0
109114
- testtidb6.5.3
110115
# - testtidb6.5.10

0 commit comments

Comments
 (0)