forked from cupy/cupy
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (60 loc) · 2.13 KB
/
flexci.yml
File metadata and controls
69 lines (60 loc) · 2.13 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: "FlexCI"
on:
issue_comment:
types: [created]
pull_request_target:
types: [closed]
permissions:
contents: read
statuses: write
jobs:
dispatch:
if: |
github.repository_owner == 'cupy' &&
(
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains(github.event.comment.body, '/test ')) ||
(github.event_name == 'pull_request_target' &&
github.event.pull_request.merged &&
!contains(github.event.pull_request.labels.*.name, 'skip-ci'))
)
runs-on: ubuntu-22.04
steps:
- name: Get Base Branch of Pull Request
id: base
if: github.event_name == 'issue_comment'
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "pr_base_ref=$(gh api '${{ github.event.issue.pull_request.url }}' | jq -r .base.ref)" >> "${GITHUB_OUTPUT}"
echo "pr_merge_ref=refs/pull/${{ github.event.issue.number }}/merge" >> "${GITHUB_OUTPUT}"
- name: Checkout (Base Branch)
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'issue_comment' && steps.base.outputs.pr_base_ref || github.event.pull_request.merge_commit_sha }}
- name: Checkout (Untrusted Pull-Request Code)
if: github.event_name == 'issue_comment'
uses: actions/checkout@v4
with:
ref: ${{ steps.base.outputs.pr_merge_ref }}
path: _pr_untrusted
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Setup Environment
run: |
pip install pygithub
- name: Dispatch
env:
GITHUB_TOKEN: ${{ github.token }}
FLEXCI_WEBHOOK_SECRET: ${{ secrets.FLEXCI_WEBHOOK_SECRET }}
PROJECTS_ROOT_DIR: ${{ github.event_name == 'issue_comment' && '_pr_untrusted' || '.' }}
run: |
./.github/workflows/scripts/flexci_dispatcher.py \
--event "${GITHUB_EVENT_NAME}" \
--webhook "${GITHUB_EVENT_PATH}" \
--projects "${PROJECTS_ROOT_DIR}/.pfnci/config.tags.json" \
--external-tag jenkins \
--external-tag rocm