Skip to content

Commit

Permalink
ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
niukuo committed Jan 22, 2025
1 parent 0d0583a commit c95445c
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 16 deletions.
62 changes: 46 additions & 16 deletions .github/workflows/blossom-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ on:
types: [created]
workflow_dispatch:
inputs:
platform:
description: 'runs-on argument'
required: false
args:
description: 'argument'
sha:
description: 'commit sha'
required: true
test_results_url:
description: 'test results url'
required: false
jobs:
Authorization:
Expand All @@ -35,7 +35,7 @@ jobs:

# This job only runs for pull request comments
if: |
github.event.comment.body == '/build' && (github.actor == 'niukuo' || github.actor == 'niukuo')
github.event.comment.body == '/build' && contains('["niukuo"]', github.actor)
steps:
- name: Check if comment is issued by authorized person
run: blossom-ci
Expand Down Expand Up @@ -78,14 +78,44 @@ jobs:
CI_SERVER: ${{ secrets.CI_SERVER }}
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Upload-Log:
name: Upload log
runs-on: blossom
if : github.event_name == 'workflow_dispatch'
Upload-Test:
name: Upload test results
runs-on: niukuo
if: github.event_name == 'workflow_dispatch'
steps:
- name: Jenkins log for pull request ${{ fromJson(github.event.inputs.args).pr }} (click here)
run: blossom-ci
env:
OPERATION: 'POST-PROCESSING'
CI_SERVER: ${{ secrets.CI_SERVER }}
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Collect test result
run: rm -rf results && mkdir results && cd results && curl -L ${{ github.event.inputs.test_results_url }} | tar -xz
- name: Create test summary
id: test_summary
uses: test-summary/action@dist
with:
paths: results/**/results*.xml
- name: Update success pr status
uses: actions/github-script@v6
if: ${{ steps.test_summary.outputs.failed == 0 }}
with:
script: |
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
context: 'blossom-ci',
sha: '${{ github.event.inputs.sha }}',
target_url: 'https://github.com/NVIDIA/TensorRT-LLM/actions/runs/' + context.runId,
state: 'success',
description: '${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }} tests passed',
})
- name: Update failure pr status
uses: actions/github-script@v6
if: ${{ steps.test_summary.outputs.failed != 0 }}
with:
script: |
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
context: 'blossom-ci',
sha: '${{ github.event.inputs.sha }}',
target_url: 'https://github.com/NVIDIA/TensorRT-LLM/actions/runs/' + context.runId,
state: 'failure',
description: '${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }} tests failed',
})
57 changes: 57 additions & 0 deletions .github/workflows/blossom-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Blossom-Test
on:
workflow_dispatch:
inputs:
test_results_url:
description: 'test results url'
required: false
sha:
description: 'commit sha'
required: true
jobs:
Upload-Test:
name: Upload test results
runs-on: niukuo
if: github.event_name == 'workflow_dispatch' && false
steps:
- name: Collect test result
run: rm -rf results && mkdir results && cd results && curl -L ${{ github.event.inputs.test_results_url }} | tar -xz
- name: Jenkins log for commit ${{ github.event.inputs.sha }} (click here)
uses: mikepenz/action-junit-report@v5
with:
report_paths: 'results/**/results*.xml'
include_passed: false
Update-Status:
name: Update test status
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Update pr status
id: set-result
uses: actions/github-script@v6
with:
script: |
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
context: 'blossom-ci',
sha: github.event.inputs.sha,
target_url: github.context.runId,
description: 'test done',
})

0 comments on commit c95445c

Please sign in to comment.