Skip to content

sdk: 优化 arun 方法,新增 collect_output 参数并返回文件大小 #43

sdk: 优化 arun 方法,新增 collect_output 参数并返回文件大小

sdk: 优化 arun 方法,新增 collect_output 参数并返回文件大小 #43

# This is a basic workflow to help you get started with Actions
name: CI Request Trigger
# Controls when the workflow will run
on:
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# work on CI script dir
defaults:
run:
working-directory: .github/scripts
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Runs trigger CI
- name: Make the script files executable
run: chmod +x trigger-CI.sh get-CI-result.sh
- name: trigger a CI
run: |
COMMIT_ID=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.event.pull_request.head.sha }}" || echo "${{ github.sha }}")
echo "Using Commit ID: $COMMIT_ID"
echo "$GITHUB_REF"
PR_ID=$(echo "$GITHUB_REF" | sed 's@refs/pull/\([0-9]\+\)/.*@\1@')
echo "PR ID is $PR_ID"
./trigger-CI.sh "$COMMIT_ID" "${{ secrets.CI_SECRET }}" "${{ github.event.pull_request.head.repo.clone_url }}" "$PR_ID"
# Runs get CI result
- name: Get CI result
run: |
COMMIT_ID=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.event.pull_request.head.sha }}" || echo "${{ github.sha }}")
echo "Using Commit ID: $COMMIT_ID"
./get-CI-result.sh "$COMMIT_ID" "${{ secrets.CI_SECRET }}"