Skip to content

Workflow file for this run

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'
})