Skip to content

Commit c384d26

Browse files
authored
migrate to l0-test.yml (#2858)
Signed-off-by: niukuo <[email protected]>
1 parent 225b776 commit c384d26

File tree

1 file changed

+35
-44
lines changed

1 file changed

+35
-44
lines changed

.github/workflows/blossom-ci.yml renamed to .github/workflows/l0-test.yml

+35-44
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515

1616
# A workflow to trigger ci on hybrid infra (github + self hosted runner)
17-
name: Blossom-CI
17+
name: L0-Test
1818
on:
1919
issue_comment:
2020
types: [created]
@@ -25,63 +25,54 @@ on:
2525
required: true
2626
test_result:
2727
description: 'test result'
28-
required: true
28+
required: false
2929
test_results_url:
3030
description: 'test results url'
3131
required: true
3232
jobs:
3333
Authorization:
34-
name: Authorization
35-
runs-on: blossom
36-
outputs:
37-
args: ${{ env.args }}
38-
39-
# This job only runs for pull request comments
40-
if: |
41-
startsWith( github.event.comment.body, '/bot' ) && contains('["chzblych", "tburt-nv", "niukuo"]', github.actor)
42-
steps:
43-
- name: Check if comment is issued by authorized person
44-
run: blossom-ci
45-
env:
46-
OPERATION: 'AUTH'
47-
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
49-
50-
Vulnerability-scan:
51-
name: Vulnerability scan
52-
needs: [Authorization]
5334
runs-on: ubuntu-latest
35+
name: Authorization
36+
if: startsWith( github.event.comment.body, '/bot' )
5437
steps:
55-
- name: Checkout code
56-
uses: actions/checkout@v2
57-
with:
58-
repository: ${{ fromJson(needs.Authorization.outputs.args).repo }}
59-
ref: ${{ fromJson(needs.Authorization.outputs.args).ref }}
60-
lfs: 'true'
61-
62-
- name: Run blossom action
63-
uses: NVIDIA/blossom-action@main
64-
env:
65-
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
38+
- name: Check Team Membership
39+
uses: actions/github-script@v6
6740
with:
68-
args1: ${{ fromJson(needs.Authorization.outputs.args).args1 }}
69-
args2: ${{ fromJson(needs.Authorization.outputs.args).args2 }}
70-
args3: ${{ fromJson(needs.Authorization.outputs.args).args3 }}
41+
github-token: ${{ secrets.CI_TEAM_TOKEN }}
42+
script: |
43+
try {
44+
const { data: membership } = await github.rest.teams.getMembershipForUserInOrg({
45+
org: context.repo.owner,
46+
team_slug: 'trt-llm-ci-approvers',
47+
username: context.actor,
48+
});
49+
if (membership.state != 'active') {
50+
core.setFailed('only member in [trt-llm-ci-approvers] can run', membership)
51+
}
52+
} catch (error) {
53+
console.log('check membership failed:', error);
54+
core.setFailed('only member in [trt-llm-ci-approvers] can run')
55+
}
7156
7257
Job-trigger:
7358
name: Start ci job
74-
needs: [Vulnerability-scan]
75-
runs-on: blossom
59+
needs: [Authorization]
60+
runs-on: [self-hosted, Linux, Jenkins]
7661
steps:
7762
- name: Start ci job
78-
run: blossom-ci
79-
env:
80-
OPERATION: 'START-CI-JOB'
81-
CI_SERVER: ${{ secrets.CI_SERVER }}
82-
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
run: |
64+
CI_SERVER="${{ secrets.CI_SERVER }}"
65+
JENKINS_URL=$(echo "$CI_SERVER" | cut -d '@' -f 1)
66+
TOKEN=$(echo "$CI_SERVER" | cut -d '@' -f 2)
67+
68+
echo '${{ toJson(github.event) }}' > githubData.json
69+
70+
curl -s -X POST \
71+
-H "Content-Type: application/json" \
72+
-d @githubData.json \
73+
"$JENKINS_URL/generic-webhook-trigger/invoke?token=$TOKEN"
8374
84-
Upload-results:
75+
Upload-Test:
8576
name: Upload test results
8677
runs-on: linux-amd64-cpu4
8778
if: github.event_name == 'workflow_dispatch'

0 commit comments

Comments
 (0)