forked from rapidsai/velox-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (116 loc) Β· 4.49 KB
/
Copy pathcreate-staging-composite.yml
File metadata and controls
128 lines (116 loc) Β· 4.49 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Create Staging Branch (Reusable)
on:
workflow_call:
inputs:
base_repository:
description: 'Base repository (e.g., facebookincubator/velox)'
type: string
required: true
base_branch:
description: 'Base branch to sync from'
type: string
required: true
target_repository:
description: 'Target repository (e.g., rapidsai/velox)'
type: string
required: true
target_branch:
description: 'Target branch name'
type: string
required: true
default: 'staging'
auto_fetch_prs:
description: 'Auto-fetch non-draft PRs with specified label'
type: boolean
required: false
default: true
pr_labels:
description: 'Comma-separated PR labels to auto-fetch'
type: string
required: false
default: ''
manual_pr_numbers:
description: 'Comma-separated PR numbers to merge'
type: string
required: false
default: ''
exclude_pr_numbers:
description: 'Comma-separated PR numbers to exclude from auto-fetch results'
type: string
required: false
default: ''
force_push:
description: 'Force push to target branch'
type: boolean
required: false
default: false
additional_repository:
description: 'Additional repository to merge from'
type: string
required: false
default: ''
additional_branch:
description: 'Branch from additional repository to merge'
type: string
required: false
default: ''
script_path:
description: 'Path to the staging script (e.g., ./velox-testing/velox/scripts/create_staging.sh)'
type: string
required: true
secrets:
fork_pat:
description: 'GitHub PAT for target repository'
required: true
jobs:
create-staging:
runs-on: linux-amd64-cpu4
permissions:
contents: write
env:
GH_TOKEN: ${{ secrets.fork_pat }}
TARGET_REPO: ${{ inputs.target_repository }}
SCRIPT_PATH: ${{ inputs.script_path }}
BASE_ARGS: >-
--mode ci
--base-repository ${{ inputs.base_repository }}
--base-branch ${{ inputs.base_branch }}
--target-branch ${{ inputs.target_branch }}
--auto-fetch-prs ${{ inputs.auto_fetch_prs }}
${{ inputs.pr_labels && format('--pr-labels {0}', inputs.pr_labels) || '' }}
${{ inputs.manual_pr_numbers && format('--manual-pr-numbers {0}', inputs.manual_pr_numbers) || '' }}
${{ inputs.exclude_pr_numbers && format('--exclude-pr-numbers {0}', inputs.exclude_pr_numbers) || '' }}
${{ inputs.additional_repository && format('--additional-repository {0}', inputs.additional_repository) || '' }}
${{ inputs.additional_branch && format('--additional-branch {0}', inputs.additional_branch) || '' }}
--force-push ${{ inputs.force_push }}
steps:
- name: π¦ Checkout velox-testing
uses: actions/checkout@v4
with:
path: velox-testing
- name: βοΈ Setup Git Configuration
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: π₯ Clone target repository
run: |
# Extract project name from script path (e.g., velox from ./velox-testing/velox/scripts/...)
TARGET_DIR=$(echo "${SCRIPT_PATH}" | sed 's|.*/velox-testing/||' | cut -d'/' -f1)
git clone "https://x-access-token:${GH_TOKEN}@github.com/${TARGET_REPO}.git" "${TARGET_DIR}"
- name: π Reset target branch
run: ${SCRIPT_PATH} ${BASE_ARGS} --step reset
- name: π Merge additional repository/branch
if: ${{ inputs.additional_repository != '' && inputs.additional_branch != '' }}
run: ${SCRIPT_PATH} ${BASE_ARGS} --step merge-additional
- name: π Fetch PR list
run: ${SCRIPT_PATH} ${BASE_ARGS} --step fetch-prs
- name: π§ͺ Test merge compatibility
run: ${SCRIPT_PATH} ${BASE_ARGS} --step test-merge
- name: π§ͺ Test pairwise merge compatibility
run: ${SCRIPT_PATH} ${BASE_ARGS} --step test-pairwise
- name: π Merge PRs
run: ${SCRIPT_PATH} ${BASE_ARGS} --step merge
- name: π Create staging manifest
run: ${SCRIPT_PATH} ${BASE_ARGS} --step manifest
- name: π Push branches
run: ${SCRIPT_PATH} ${BASE_ARGS} --step push