Skip to content

Commit 962b447

Browse files
committed
update all related workflows
1 parent b4f2cc6 commit 962b447

File tree

6 files changed

+77
-11
lines changed

6 files changed

+77
-11
lines changed

.github/workflows/_run-e2e-single.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
image-name:
1010
required: true
1111
type: string
12+
python-versions:
13+
required: true
14+
type: string
15+
description: JSON array of Python versions
1216

1317
jobs:
1418
run-e2e:
@@ -19,7 +23,7 @@ jobs:
1923
strategy:
2024
fail-fast: false
2125
matrix:
22-
python-version: ${{ fromJson(vars.SDK_SUPPORTED_PYTHON_VERSIONS) }}
26+
python-version: ${{ fromJson(inputs.python-versions) }}
2327

2428
steps:
2529
- name: Check-out repository
@@ -80,4 +84,4 @@ jobs:
8084
8185
done
8286
echo "Tests failed after 3 attempts"
83-
exit 1
87+
exit 1

.github/workflows/compatibility.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,25 @@ on:
88
- "pyproject.toml"
99

1010
jobs:
11+
read-python-versions:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
python-versions: ${{ steps.read-versions.outputs.versions }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- id: read-versions
18+
run: |
19+
versions=$(cat .github/supported-python-versions.json)
20+
echo "versions=$versions" >> $GITHUB_OUTPUT
21+
1122
compatibility:
23+
needs: read-python-versions
1224
if: github.event.pull_request.draft == false
1325
runs-on: ubuntu-latest
1426

1527
strategy:
1628
matrix:
17-
python-version: ${{ fromJson(vars.SDK_SUPPORTED_PYTHON_VERSIONS) }}
29+
python-version: ${{ fromJson(needs.read-python-versions.outputs.python-versions) }}
1830

1931
steps:
2032
- uses: actions/checkout@v4

.github/workflows/e2e-subtensor-tests.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ jobs:
7171
echo "Found tests: $test_matrix"
7272
echo "test-files=$test_matrix" >> "$GITHUB_OUTPUT"
7373
74+
# Read Python versions
75+
read-python-versions:
76+
runs-on: ubuntu-latest
77+
outputs:
78+
python-versions: ${{ steps.read-versions.outputs.versions }}
79+
steps:
80+
- uses: actions/checkout@v4
81+
- id: read-versions
82+
run: |
83+
versions=$(cat .github/supported-python-versions.json)
84+
echo "versions=$versions" >> $GITHUB_OUTPUT
85+
7486
# Pull docker image
7587
pull-docker-image:
7688
runs-on: ubuntu-latest
@@ -82,16 +94,16 @@ jobs:
8294
run: |
8395
echo "Event: $GITHUB_EVENT_NAME"
8496
echo "Branch: $GITHUB_REF_NAME"
85-
97+
8698
echo "Reading labels ..."
8799
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
88100
labels=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH")
89101
else
90102
labels=""
91103
fi
92-
104+
93105
image=""
94-
106+
95107
for label in $labels; do
96108
echo "Found label: $label"
97109
case "$label" in
@@ -147,6 +159,7 @@ jobs:
147159
needs:
148160
- find-tests
149161
- pull-docker-image
162+
- read-python-versions
150163
strategy:
151164
fail-fast: false
152165
max-parallel: 16
@@ -156,4 +169,5 @@ jobs:
156169
with:
157170
nodeid: ${{ matrix.nodeid }}
158171
image-name: ${{ needs.pull-docker-image.outputs.image-name }}
172+
python-versions: ${{ needs.read-python-versions.outputs.python-versions }}
159173
secrets: inherit

.github/workflows/flake8-and-mypy.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,27 @@ on:
77
types: [opened, synchronize, reopened, edited]
88

99
jobs:
10+
read-python-versions:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
python-versions: ${{ steps.read-versions.outputs.versions }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- id: read-versions
17+
run: |
18+
versions=$(cat .github/supported-python-versions.json)
19+
echo "versions=$versions" >> $GITHUB_OUTPUT
20+
1021
linters:
22+
needs: read-python-versions
1123
if: github.event.pull_request.draft == false
1224
runs-on: ubuntu-latest
1325

1426
strategy:
1527
fail-fast: false
1628
max-parallel: 5
1729
matrix:
18-
python-version: ${{ fromJson(vars.SDK_SUPPORTED_PYTHON_VERSIONS) }}
30+
python-version: ${{ fromJson(needs.read-python-versions.outputs.python-versions) }}
1931

2032
steps:
2133
- name: Checkout repository
@@ -47,4 +59,4 @@ jobs:
4759
run: uv run flake8 bittensor/ --count
4860

4961
- name: Mypy
50-
run: uv run mypy --ignore-missing-imports bittensor/
62+
run: uv run mypy --ignore-missing-imports bittensor/

.github/workflows/monitor_requirements_size_master.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,24 @@ permissions:
1414
contents: read
1515

1616
jobs:
17+
read-python-versions:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
python-versions: ${{ steps.read-versions.outputs.versions }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
- id: read-versions
24+
run: |
25+
versions=$(cat .github/supported-python-versions.json)
26+
echo "versions=$versions" >> $GITHUB_OUTPUT
27+
1728
measure-venv:
29+
needs: read-python-versions
1830
if: github.event_name == 'pull_request' && github.base_ref == 'master' || contains( github.event.pull_request.labels.*.name, 'show-venv-size')
1931
runs-on: ubuntu-latest
2032
strategy:
2133
matrix:
22-
python-version: ${{ fromJson(vars.SDK_SUPPORTED_PYTHON_VERSIONS) }}
34+
python-version: ${{ fromJson(needs.read-python-versions.outputs.python-versions) }}
2335
outputs:
2436
py310: ${{ steps.set-output.outputs.py310 }}
2537
py311: ${{ steps.set-output.outputs.py311 }}

.github/workflows/unit-and-integration-tests.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,27 @@ on:
77
types: [opened, synchronize, reopened, edited]
88

99
jobs:
10+
read-python-versions:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
python-versions: ${{ steps.read-versions.outputs.versions }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- id: read-versions
17+
run: |
18+
versions=$(cat .github/supported-python-versions.json)
19+
echo "versions=$versions" >> $GITHUB_OUTPUT
20+
1021
unit-and-integration-tests:
22+
needs: read-python-versions
1123
if: github.event.pull_request.draft == false
1224
runs-on: ubuntu-latest
1325

1426
strategy:
1527
fail-fast: false
1628
max-parallel: 5
1729
matrix:
18-
python-version: ${{ fromJson(vars.SDK_SUPPORTED_PYTHON_VERSIONS) }}
30+
python-version: ${{ fromJson(needs.read-python-versions.outputs.python-versions) }}
1931

2032
steps:
2133
- name: Checkout repository
@@ -56,4 +68,4 @@ jobs:
5668
env:
5769
PYTHONUNBUFFERED: "1"
5870
run: |
59-
uv run pytest -n 2 tests/integration_tests/ --reruns 3
71+
uv run pytest -n 2 tests/integration_tests/ --reruns 3

0 commit comments

Comments
 (0)