Skip to content

Commit 5614c82

Browse files
Update CI.yml
1 parent 37108ae commit 5614c82

File tree

1 file changed

+45
-12
lines changed

1 file changed

+45
-12
lines changed

.github/workflows/CI.yml

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
1-
name: RDF CI
2-
on: [push]
1+
name: Jenkins CI Regression
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
38
jobs:
4-
job-name:
9+
trigger-jenkins:
510
runs-on: ubuntu-latest
6-
container:
7-
image: ghcr.io/jenkinsci/jenkinsfile-runner:master
811
steps:
9-
- uses: actions/checkout@v2
10-
- uses:
11-
jenkinsci/jfr-container-action@master
12-
with:
13-
command: run
14-
jenkinsfile: Jenkinsfile
15-
pluginstxt: plugins.txt
12+
- name: Trigger Jenkins Build
13+
id: trigger
14+
run: |
15+
echo "Triggering Jenkins job..."
16+
RESPONSE=$(curl -s -X POST \
17+
-u "${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }}" \
18+
"${{ secrets.JENKINS_URL }}/job/${{ secrets.JENKINS_JOB }}/buildWithParameters?token=${{ secrets.JENKINS_TRIGGER }}" -i)
19+
echo "$RESPONSE"
20+
21+
- name: Wait for Jenkins Build to Complete
22+
id: wait
23+
run: |
24+
echo "Polling Jenkins for completion..."
25+
ATTEMPTS=0
26+
BUILD_STATUS="PENDING"
27+
until [ "$BUILD_STATUS" = "SUCCESS" ] || [ "$BUILD_STATUS" = "FAILURE" ]; do
28+
sleep 30
29+
BUILD_STATUS=$(curl -s -u "${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }}" \
30+
"${{ secrets.JENKINS_URL }}/job/${{ secrets.JENKINS_JOB }}/lastBuild/api/json" \
31+
| jq -r '.result')
32+
echo "[$ATTEMPTS] Current status: $BUILD_STATUS"
33+
ATTEMPTS=$((ATTEMPTS + 1))
34+
if [ $ATTEMPTS -gt 60 ]; then
35+
echo "Timed out after 30 minutes."
36+
exit 1
37+
fi
38+
done
39+
echo "Final Jenkins status: $BUILD_STATUS"
40+
echo "status=${BUILD_STATUS}" >> $GITHUB_OUTPUT
41+
42+
- name: Mark PR Failed if Jenkins Failed
43+
if: steps.wait.outputs.status == 'FAILURE'
44+
run: exit 1
45+
46+
- name: Jenkins Build Succeeded
47+
if: steps.wait.outputs.status == 'SUCCESS'
48+
run: echo "✅ Jenkins Regression Passed Successfully"

0 commit comments

Comments
 (0)