Skip to content

Commit e7318f5

Browse files
committed
check FlagCICD connection before upload coverage
1 parent 338414d commit e7318f5

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

.github/workflows/unit_tests_common.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ jobs:
7979
fail-fast: false
8080
matrix:
8181
test_group:
82-
- name: license
83-
path: "qa/L0_license/test.sh"
84-
test_type: "license"
8582
- name: pytorch_lint
8683
path: "qa/L0_pytorch_lint/test.sh"
8784
test_type: "lint"
@@ -114,10 +111,11 @@ jobs:
114111
else
115112
CHANGED='${{ needs.detect_changes.outputs.core }}'
116113
fi
114+
117115
# For debugging, you can force this to true
118116
echo "should_run=true" >> $GITHUB_OUTPUT
119117
120-
- name: Checkout source code
118+
- name: Checkout Source Code
121119
if: steps.should_run.outputs.should_run == 'true'
122120
uses: actions/checkout@v4
123121
with:
@@ -135,7 +133,7 @@ jobs:
135133
# echo "PATH=$PATH" >> $GITHUB_ENV
136134
# echo "Python: $(which python3) ($(python3 --version 2>&1))"
137135

138-
- name: Environment Setup Cuda-specific
136+
- name: Environment Setup on Cuda
139137
if: steps.should_run.outputs.should_run == 'true' && inputs.platform == 'cuda'
140138
run: |
141139
set -euo pipefail
@@ -159,7 +157,7 @@ jobs:
159157
160158
echo "===== Environment Setup Complete ===== "
161159
162-
- name: Environment Setup Metax-specific
160+
- name: Environment Setup on Metax
163161
if: steps.should_run.outputs.should_run == 'true' && inputs.platform == 'metax'
164162
run: |
165163
set -euo pipefail
@@ -304,8 +302,21 @@ jobs:
304302
path: |
305303
coverage-${{ inputs.platform }}-${{ inputs.device }}.json
306304
307-
- name: Upload Coverage Report to FlagCICD
305+
- name: Check FlagCICD Reachability
308306
if: inputs.upload_coverage && matrix.test_group.test_type == 'unittest'
307+
id: check_flagcicd
308+
continue-on-error: true
309+
run: |
310+
if curl -sf --max-time 3 --connect-timeout 2 \
311+
"http://flagcicd-inner.flagos.net:8000/" -o /dev/null 2>/dev/null; then
312+
echo "reachable=true" >> $GITHUB_OUTPUT
313+
else
314+
echo "reachable=false" >> $GITHUB_OUTPUT
315+
echo "INFO: flagcicd-inner.flagos.net unreachable from this runner, skipping report upload"
316+
fi
317+
318+
- name: Upload Coverage Report to FlagCICD
319+
if: inputs.upload_coverage && matrix.test_group.test_type == 'unittest' && steps.check_flagcicd.outputs.reachable == 'true'
309320
uses: flagos-ai/FlagOps/actions/post-pytest-report@v2
310321
continue-on-error: true
311322
with:

0 commit comments

Comments
 (0)