mirror of https://github.com/asterisk/asterisk
parent
936d2006f2
commit
c535a1d2cd
@ -1,17 +1,124 @@
|
|||||||
name: PRCherryPickTest
|
name: PRCPCheck
|
||||||
run-name: "PR ${{github.event.number}} CherryPickTest"
|
run-name: "PR ${{ github.event.number }} CherryPickTest"
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [ labeled ]
|
types: [ labeled ]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{github.workflow}}-${{github.event.label.name}}-${{github.event.number}}
|
group: ${{ github.workflow }}-${{ github.event.label.name }}-${{ github.event.number }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
PR_NUMBER: ${{ github.event.number }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
CherryPickTest:
|
Setup:
|
||||||
name: CherryPickTest
|
|
||||||
if: ${{ github.event.label.name == vars.CHERRY_PICK_TEST_LABEL }}
|
if: ${{ github.event.label.name == vars.CHERRY_PICK_TEST_LABEL }}
|
||||||
uses: asterisk/asterisk-ci-actions/.github/workflows/AsteriskCherryPickTest.yml@main
|
name: Setup
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
branches: ${{ steps.getbranches.outputs.branches }}
|
||||||
|
branch_count: ${{ steps.getbranches.outputs.branch_count }}
|
||||||
|
testsuite_test_pr: ${{ steps.testsuitepr.outputs.testsuite_test_pr }}
|
||||||
|
steps:
|
||||||
|
- name: Remove Trigger Label, Add InProgress Label
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
gh pr edit --repo ${{ github.repository }} \
|
||||||
|
--remove-label ${{ vars.CHERRY_PICK_TEST_LABEL }} \
|
||||||
|
--remove-label ${{ vars.CHERRY_PICK_CHECKS_PASSED_LABEL }} \
|
||||||
|
--remove-label ${{ vars.CHERRY_PICK_CHECKS_FAILED_LABEL }} \
|
||||||
|
--remove-label ${{ vars.CHERRY_PICK_TESTING_IN_PROGRESS }} \
|
||||||
|
$PR_NUMBER || :
|
||||||
|
|
||||||
|
- name: Get cherry-pick branches
|
||||||
|
uses: asterisk/asterisk-ci-actions/GetCherryPickBranchesFromPR@main
|
||||||
|
id: getbranches
|
||||||
|
with:
|
||||||
|
repo: ${{ github.repository }}
|
||||||
|
pr_number: ${{ env.PR_NUMBER }}
|
||||||
|
cherry_pick_regex: ${{ vars.CHERRY_PICK_REGEX }}
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Check Branch Count
|
||||||
|
if: ${{ steps.getbranches.outputs.branch_count > 0 }}
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
gh pr edit --repo ${{ github.repository }} \
|
||||||
|
--add-label ${{ vars.CHERRY_PICK_TESTING_IN_PROGRESS }} \
|
||||||
|
$PR_NUMBER || :
|
||||||
|
|
||||||
|
- name: GetTestsuitePR
|
||||||
|
id: testsuitepr
|
||||||
|
uses: asterisk/asterisk-ci-actions/GetTestsuitePRFromAsteriskPR@main
|
||||||
|
with:
|
||||||
|
repo: ${{ github.repository }}
|
||||||
|
pr_number: ${{ github.event.number }}
|
||||||
|
testsuite_test_pr_regex: ${{ vars.TESTSUITE_TEST_PR_REGEX }}
|
||||||
|
testsuite_test_auto_merge_regex: ${{ vars.TESTSUITE_TEST_AUTO_MERGE_REGEX }}
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: CherryPick
|
||||||
|
uses: asterisk/asterisk-ci-actions/CherryPick@main
|
||||||
|
with:
|
||||||
|
repo: ${{ github.repository }}
|
||||||
|
pr_number: ${{ github.event.number }}
|
||||||
|
branches: ${{ steps.getbranches.outputs.branches }}
|
||||||
|
push: false
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
debug: false
|
||||||
|
|
||||||
|
Check:
|
||||||
|
needs: [Setup]
|
||||||
|
if: ${{ needs.Setup.outputs.branch_count > 0 && ( success() ) }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
branch: ${{ fromJSON(needs.Setup.outputs.branches) }}
|
||||||
|
uses: asterisk/asterisk-ci-actions/.github/workflows/AsteriskUnitGateTest.yml@main
|
||||||
|
with:
|
||||||
|
test_type: cherry-pick
|
||||||
|
asterisk_repo: ${{ github.repository }}
|
||||||
|
pr_number: ${{ github.event.number }}
|
||||||
|
base_branch: ${{ matrix.branch }}
|
||||||
|
is_cherry_pick: true
|
||||||
|
build_options: ${{ vars.BUILD_OPTIONS }}
|
||||||
|
unittest_command: ${{ vars.UNITTEST_COMMAND }}
|
||||||
|
testsuite_repo: ${{ vars.TESTSUITE_REPO }}
|
||||||
|
testsuite_test_pr: ${{ needs.Setup.outputs.testsuite_test_pr }}
|
||||||
|
gatetest_list: ${{ vars.GATETEST_LIST }}
|
||||||
|
gatetest_commands: ${{ vars.GATETEST_COMMANDS }}
|
||||||
secrets:
|
secrets:
|
||||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
Cleanup:
|
||||||
|
if: ${{ success() || failure() }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [Setup,Check]
|
||||||
|
steps:
|
||||||
|
- name: Check status
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
RESULT_UNIT: ${{ needs.Check.result }}
|
||||||
|
TESTS_PASSED: ${{ vars.CHERRY_PICK_CHECKS_PASSED_LABEL }}
|
||||||
|
TESTS_FAILED: ${{ vars.CHERRY_PICK_CHECKS_FAILED_LABEL }}
|
||||||
|
run: |
|
||||||
|
declare -i rc=0
|
||||||
|
case $RESULT_UNIT in
|
||||||
|
success)
|
||||||
|
;;
|
||||||
|
skipped)
|
||||||
|
rc+=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
rc+=1
|
||||||
|
esac
|
||||||
|
[ $rc -gt 0 ] && label=$TESTS_FAILED || label=$TESTS_PASSED
|
||||||
|
gh pr edit --repo ${{ github.repository }} \
|
||||||
|
--remove-label ${{ vars.CHERRY_PICK_TESTING_IN_PROGRESS }} \
|
||||||
|
--add-label $label \
|
||||||
|
$PR_NUMBER || :
|
||||||
|
exit $rc
|
||||||
|
|
||||||
|
@ -1,18 +1,89 @@
|
|||||||
name: PRRecheck
|
name: PRReCheck
|
||||||
run-name: "PR ${{github.event.number}} Recheck"
|
run-name: "PR ${{ github.event.number }} Recheck"
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [ labeled ]
|
types: [ labeled ]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{github.workflow}}-${{github.event.label.name}}-${{github.event.number}}
|
group: check-${{ github.event.number }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
PR_NUMBER: ${{ github.event.number }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
PRCheck:
|
Setup:
|
||||||
name: PRCheck
|
|
||||||
if: ${{ github.event.label.name == vars.RECHECKPR_LABEL }}
|
if: ${{ github.event.label.name == vars.RECHECKPR_LABEL }}
|
||||||
uses: asterisk/asterisk-ci-actions/.github/workflows/AsteriskRecheckPR.yml@main
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
testsuite_test_pr: ${{ steps.testsuitepr.outputs.testsuite_test_pr }}
|
||||||
|
steps:
|
||||||
|
- name: Set Label
|
||||||
|
id: setlabel
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
gh pr edit --repo ${{ github.repository }} \
|
||||||
|
--remove-label ${{ vars.RECHECKPR_LABEL }} \
|
||||||
|
--remove-label ${{ vars.PR_SUBMIT_TESTS_PASSED }} \
|
||||||
|
--remove-label ${{ vars.PR_SUBMIT_TESTS_FAILED }} \
|
||||||
|
--add-label ${{ vars.PR_SUBMIT_TESTING_IN_PROGRESS }} \
|
||||||
|
$PR_NUMBER || :
|
||||||
|
|
||||||
|
- name: GetTestsuitePR
|
||||||
|
id: testsuitepr
|
||||||
|
uses: asterisk/asterisk-ci-actions/GetTestsuitePRFromAsteriskPR@main
|
||||||
|
with:
|
||||||
|
repo: ${{ github.repository }}
|
||||||
|
pr_number: ${{ github.event.number }}
|
||||||
|
testsuite_test_pr_regex: ${{ vars.TESTSUITE_TEST_PR_REGEX }}
|
||||||
|
testsuite_test_auto_merge_regex: ${{ vars.TESTSUITE_TEST_AUTO_MERGE_REGEX }}
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
ReCheck:
|
||||||
|
name: ReCheck
|
||||||
|
needs: Setup
|
||||||
|
uses: asterisk/asterisk-ci-actions/.github/workflows/AsteriskUnitGateTest.yml@main
|
||||||
|
with:
|
||||||
|
test_type: prrecheck
|
||||||
|
asterisk_repo: ${{ github.repository }}
|
||||||
|
pr_number: ${{ github.event.number }}
|
||||||
|
base_branch: ${{ github.event.pull_request.base.ref }}
|
||||||
|
is_cherry_pick: false
|
||||||
|
build_options: ${{ vars.BUILD_OPTIONS }}
|
||||||
|
unittest_command: ${{ vars.UNITTEST_COMMAND }}
|
||||||
|
testsuite_repo: ${{ vars.TESTSUITE_REPO }}
|
||||||
|
testsuite_test_pr: ${{ needs.Setup.outputs.testsuite_test_pr }}
|
||||||
|
gatetest_list: ${{ vars.GATETEST_LIST }}
|
||||||
|
gatetest_commands: ${{ vars.GATETEST_COMMANDS }}
|
||||||
secrets:
|
secrets:
|
||||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
Cleanup:
|
||||||
|
if: ${{ success() || failure() }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [Setup,ReCheck]
|
||||||
|
steps:
|
||||||
|
- name: Check status
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
RESULT_UNIT: ${{ needs.ReCheck.result }}
|
||||||
|
TESTS_PASSED: ${{ vars.PR_SUBMIT_TESTS_PASSED }}
|
||||||
|
TESTS_FAILED: ${{ vars.PR_SUBMIT_TESTS_FAILED }}
|
||||||
|
run: |
|
||||||
|
declare -i rc=0
|
||||||
|
case $RESULT_UNIT in
|
||||||
|
success)
|
||||||
|
;;
|
||||||
|
skipped)
|
||||||
|
rc+=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
rc+=1
|
||||||
|
esac
|
||||||
|
[ $rc -gt 0 ] && label=$TESTS_FAILED || label=$TESTS_PASSED
|
||||||
|
gh pr edit --repo ${{ github.repository }} \
|
||||||
|
--remove-label ${{ vars.PR_SUBMIT_TESTING_IN_PROGRESS }} \
|
||||||
|
--add-label $label \
|
||||||
|
$PR_NUMBER || :
|
||||||
|
exit $rc
|
||||||
|
Loading…
Reference in new issue