-
Notifications
You must be signed in to change notification settings - Fork 529
51 lines (46 loc) · 1.5 KB
/
jenkins-driver-tests.yml
File metadata and controls
51 lines (46 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Run Jenkins driver tests
on:
pull_request:
paths:
- 'drivers/**'
pull_request_target:
paths:
- 'drivers/**'
permissions:
statuses: write
jobs:
trigger-driver-test:
strategy:
matrix:
version:
[ 59, 60, dev]
runs-on: ubuntu-latest
steps:
- name: Create Commit Status (Pending)
id: status
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
core.setOutput('status_url', (await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha,
state: 'pending',
description: 'Jenkins job triggered...',
context: 'Driver Tests (${{ matrix.version }})'
})).data.url);
- name: Trigger Jenkins Generic Webhook
env:
JENKINS_WEBHOOK_TOKEN: ${{ secrets.JENKINS_WEBHOOK_TOKEN }}
JENKINS_WEBHOOK_URL: ${{ secrets.JENKINS_WEBHOOK_URL }}
STATUS_URL: ${{ steps.status.outputs.status_url }}
run: |
set +x
curl -s -o /dev/null -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${JENKINS_WEBHOOK_TOKEN}" \
-d "{\"status_url\": \"$STATUS_URL\",
\"version\": ${{ matrix.version }},
\"commit\": ${{ github.event.pull_request.head.sha }} }" \
"${JENKINS_WEBHOOK_URL}"
set -x