Skip to content

Commit 6219525

Browse files
authored
Merge pull request #2898 from opentensor/fix/roman/improve-skipping-job
e2e workflow: improve skipping logic (no error when skip the job)
2 parents 155ca25 + c95b7cb commit 6219525

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

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

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,31 @@ jobs:
128128
fi
129129
done
130130
131+
# run non-fast-blocks only on Saturday and by cron schedule
132+
check-if-saturday:
133+
if: github.event_name == 'schedule'
134+
runs-on: ubuntu-latest
135+
outputs:
136+
is-saturday: ${{ steps.check.outputs.is-saturday }}
137+
steps:
138+
- id: check
139+
run: |
140+
day=$(date -u +%u)
141+
echo "Today is weekday $day"
142+
if [ "$day" -ne 6 ]; then
143+
echo "⏭️ Skipping: not Saturday"
144+
echo "is-saturday=false" >> "$GITHUB_OUTPUT"
145+
exit 0
146+
fi
147+
echo "is-saturday=true"
148+
echo "is-saturday=true" >> "$GITHUB_OUTPUT"
149+
131150
132151
cron-run-non-fast-blocks-e2e-test:
133-
if: github.event_name == 'schedule'
152+
if: github.event_name == 'schedule' && needs.check-if-saturday.outputs.is-saturday == 'true'
134153
name: "NFB: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}"
135154
needs:
155+
- check-if-saturday
136156
- find-tests
137157
- pull-docker-image
138158
runs-on: ubuntu-latest
@@ -148,14 +168,6 @@ jobs:
148168
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
149169

150170
steps:
151-
- name: Check if today is Saturday
152-
run: |
153-
day=$(date -u +%u)
154-
echo "Today is weekday $day"
155-
if [ "$day" -ne 6 ]; then
156-
echo "⏭️ Skipping: not Saturday"
157-
exit 78
158-
fi
159171
- name: Check-out repository
160172
uses: actions/checkout@v4
161173

0 commit comments

Comments
 (0)