-
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (76 loc) · 2.7 KB
/
rocm-ci.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
on:
repository_dispatch:
types: [rocm-ci]
env:
SOURCE_REPO_OWNER: 'cupy'
SOURCE_REPO_NAME: 'test-repo-dispatch' # XXX
jobs:
test:
runs-on: ubuntu-latest # XXX
steps:
- name: Generate Token (Pending)
id: generate-token-pre
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GH_APP_SELF_HOSTED_CI_ID }}
private-key: ${{ secrets.GH_APP_SELF_HOSTED_CI_PEM }}
owner: ${{ env.SOURCE_REPO_OWNER }}
repositories: ${{ env.SOURCE_REPO_NAME }}
- name: 'Update Commit Status (Pending)'
uses: actions/github-script@v7
with:
github-token: ${{ steps.generate-token-pre.outputs.token }}
script: |
console.log(JSON.stringify(context.payload, null, 2));
github.rest.repos.createCommitStatus({
owner: process.env.SOURCE_REPO_OWNER,
repo: process.env.SOURCE_REPO_NAME,
sha: context.payload.client_payload.sha,
state: 'pending',
context: context.payload.action,
description: 'In progress'
})
- name: 'Checkout'
uses: actions/checkout@v4
with:
repository: ${{ env.SOURCE_REPO_OWNER }}/${{ env.SOURCE_REPO_NAME }}
ref: ${{ github.event.client_payload.sha }}
submodules: recursive
- run: sleep 300
- name: Generate Token (Success/Failure)
if: always()
id: generate-token-post
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GH_APP_SELF_HOSTED_CI_ID }}
private-key: ${{ secrets.GH_APP_SELF_HOSTED_CI_PEM }}
owner: ${{ env.SOURCE_REPO_OWNER }}
repositories: ${{ env.SOURCE_REPO_NAME }}
- name: 'Update Commit Status (Success)'
uses: actions/github-script@v7
if: success()
with:
github-token: ${{ steps.generate-token-post.outputs.token }}
script: |
github.rest.repos.createCommitStatus({
owner: process.env.SOURCE_REPO_OWNER,
repo: process.env.SOURCE_REPO_NAME,
sha: context.payload.client_payload.sha,
state: 'success',
context: context.payload.action,
description: 'Successful'
})
- name: 'Update Commit Status (Failure)'
uses: actions/github-script@v7
if: failure()
with:
github-token: ${{ steps.generate-token-post.outputs.token }}
script: |
github.rest.repos.createCommitStatus({
owner: process.env.SOURCE_REPO_OWNER,
repo: process.env.SOURCE_REPO_NAME,
sha: context.payload.client_payload.sha,
state: 'failure',
context: context.payload.action,
description: 'Failed'
})