@@ -12,13 +12,16 @@ jobs:
1212 upstream-dev :
1313 name : upstream-dev
1414 runs-on : ubuntu-latest
15+ continue-on-error : true
1516 defaults :
1617 run :
1718 shell : bash -l {0}
1819 strategy :
1920 fail-fast : false
2021 matrix :
21- python-version : [ "3.12" ]
22+ python-version : [ "3.13" ]
23+ outputs :
24+ testresults : ${{ steps.tests.outcome }}
2225
2326 steps :
2427 - name : Checkout
5053 conda list
5154
5255 - name : Running Tests
56+ id : tests
5357 run : |
5458 python -m pytest test -v --cov=./uxarray --cov-report=xml
59+
60+ failure-issue :
61+ name : failure-issue
62+ needs : [upstream-dev]
63+ if : |
64+ needs.upstream-dev.testresults != 'success'
65+ && github.repository == 'UXARRAY/uxarray'
66+ && github.ref == 'refs/heads/main'
67+ runs-on : ubuntu-latest
68+ defaults :
69+ run :
70+ shell : bash -l {0}
71+ steps :
72+ - name : checkout
73+ uses : actions/checkout@v6.0.2
74+
75+ - name : Create or update failure issue
76+ shell : bash
77+ run : |
78+ # Read the template
79+ template=$(cat .github/upstream-failure-issue-template.md)
80+
81+ # Replace placeholders
82+ issue_body="${template//\{\{WORKFLOW\}\}/${{ github.workflow }}}"
83+ issue_body="${issue_body//\{\{RUN_ID\}\}/${{ github.run_id }}}"
84+ issue_body="${issue_body//\{\{RUN_URL\}\}/${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}}"
85+ issue_body="${issue_body//\{\{DATE\}\}/$(date -u)}"
86+
87+ # Check for existing open issue with same title
88+ issue_title="🤖 Upstream testing failure"
89+ existing_issue=$(gh issue list --state open --label "CI" --search "\"$issue_title\" in:title" --json number --jq '.[0].number // empty')
90+
91+ if [ -n "$existing_issue" ]; then
92+ echo "Found existing open issue #$existing_issue, updating it..."
93+ echo "$issue_body" | gh issue edit "$existing_issue" --body-file -
94+ echo "Updated existing issue #$existing_issue"
95+ else
96+ echo "No existing open issue found, creating new one..."
97+ echo "$issue_body" | gh issue create \
98+ --title "$issue_title" \
99+ --body-file - \
100+ --label "CI"
101+ echo "Created new issue"
102+ fi
103+ env :
104+ GH_TOKEN : ${{ github.token }}
105+
106+ report-failed :
107+ name : report-failed
108+ needs : [ upstream-dev, failure-issue ]
109+ if : ${{needs.upstream-dev.outputs.testresults != 'success'}}
110+ runs-on : ubuntu-latest
111+ defaults :
112+ run :
113+ shell : bash -l {0}
114+ steps :
115+ - name : make sure to report a failed workflow
116+ shell : bash
117+ run : |
118+ exit 1;
0 commit comments