mirror of
https://github.com/asterisk/asterisk.git
synced 2026-07-19 09:55:41 -07:00
.github: Add workflow to this branch
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||
name: Asterisk Release
|
||||
run-name: ${{ github.actor }} is creating Asterisk release ${{inputs.new_version}}
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
is_security:
|
||||
description: |
|
||||
Security or Hotfix?
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
new_version:
|
||||
description: |
|
||||
New Version:
|
||||
Examples:
|
||||
20.4.0-rc1, 20.4.0-rc2, 20.4.0, 20.4.1
|
||||
certified-20.4-cert1-rc1, certified-20.4-cert1
|
||||
required: true
|
||||
type: string
|
||||
start_version:
|
||||
description: |
|
||||
Last Version:
|
||||
Only use when you KNOW that the automated
|
||||
process won't get it right.
|
||||
required: false
|
||||
type: string
|
||||
push_release_branches:
|
||||
description: |
|
||||
Push release branches live?
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
create_github_release:
|
||||
description: |
|
||||
Create the GitHub release?
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
push_tarballs:
|
||||
description: |
|
||||
Push tarballs to downloads server?
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
send_email:
|
||||
description: |
|
||||
Send announcement emails?
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
ReleaseAsterisk:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run Releaser
|
||||
uses: asterisk/asterisk-ci-actions/AsteriskReleaserComposite@main
|
||||
with:
|
||||
is_security: ${{inputs.is_security}}
|
||||
new_version: ${{inputs.new_version}}
|
||||
start_version: ${{inputs.start_version}}
|
||||
push_release_branches: ${{inputs.push_release_branches}}
|
||||
create_github_release: ${{inputs.create_github_release}}
|
||||
push_tarballs: ${{inputs.push_tarballs}}
|
||||
send_email: ${{inputs.send_email}}
|
||||
repo: ${{github.repository}}
|
||||
asterisk_mail_list_ga: ${{vars.ASTERISK_MAIL_LIST_GA}}
|
||||
asterisk_mail_list_rc: ${{vars.ASTERISK_MAIL_LIST_RC}}
|
||||
asterisk_mail_list_cert_ga: ${{vars.ASTERISK_MAIL_LIST_CERT_GA}}
|
||||
asterisk_mail_list_cert_rc: ${{vars.ASTERISK_MAIL_LIST_CERT_RC}}
|
||||
asterisk_mail_list_sec: ${{vars.ASTERISK_MAIL_LIST_CERT_SEC}}
|
||||
gpg_private_key: ${{secrets.ASTDEV_GPG_PRIV_KEY}}
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
application_id: ${{secrets.ASTERISK_ORG_ACCESS_APP_ID}}
|
||||
application_private_key: ${{secrets.ASTERISK_ORG_ACCESS_APP_PRIV_KEY}}
|
||||
asteriskteamsa_username: ${{secrets.ASTERISKTEAMSA_GMAIL_ACCT}}
|
||||
asteriskteamsa_token: ${{secrets.ASTERISKTEAMSA_GMAIL_TOKEN}}
|
||||
deploy_ssh_priv_key: ${{secrets.ASTERISK_DEPLOY_SSH_PRIV_KEY}}
|
||||
deploy_ssh_username: ${{secrets.ASTERISK_DEPLOY_SSH_USERNAME}}
|
||||
deploy_host: ${{vars.ASTERISK_DEPLOY_HOST}}
|
||||
deploy_dir: ${{vars.ASTERISK_DEPLOY_DIR}}
|
||||
@@ -0,0 +1,167 @@
|
||||
name: CherryPickTest
|
||||
run-name: "Cherry-Pick Tests for PR ${{github.event.number}}"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [ labeled ]
|
||||
|
||||
concurrency:
|
||||
group: ${{github.workflow}}-${{github.event.number}}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.number }}
|
||||
MODULES_BLACKLIST: ${{ vars.GATETEST_MODULES_BLACKLIST }} ${{ vars.UNITTEST_MODULES_BLACKLIST }}
|
||||
|
||||
jobs:
|
||||
IdentifyBranches:
|
||||
name: IdentifyBranches
|
||||
if: ${{ github.event.label.name == vars.CHERRY_PICK_TEST_LABEL }}
|
||||
outputs:
|
||||
branches: ${{ steps.getbranches.outputs.branches }}
|
||||
branch_count: ${{ steps.getbranches.outputs.branch_count }}
|
||||
runs-on: ubuntu-latest
|
||||
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_GATES_PASSED_LABEL}} \
|
||||
--remove-label ${{vars.CHERRY_PICK_GATES_FAILED_LABEL}} \
|
||||
--remove-label ${{vars.CHERRY_PICK_TESTING_IN_PROGRESS}} \
|
||||
${{env.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}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
|
||||
CherryPickUnitTestMatrix:
|
||||
needs: [ IdentifyBranches ]
|
||||
if: ${{ needs.IdentifyBranches.outputs.branch_count > 0 && ( success() || failure() ) }}
|
||||
continue-on-error: false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJSON(needs.IdentifyBranches.outputs.branches) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run Unit Tests for branch ${{matrix.branch}}
|
||||
uses: asterisk/asterisk-ci-actions/AsteriskUnitComposite@main
|
||||
with:
|
||||
asterisk_repo: ${{github.repository}}
|
||||
pr_number: ${{env.PR_NUMBER}}
|
||||
base_branch: ${{matrix.branch}}
|
||||
is_cherry_pick: true
|
||||
modules_blacklist: ${{env.MODULES_BLACKLIST}}
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
unittest_command: ${{vars.UNITTEST_COMMAND}}
|
||||
|
||||
CherryPickUnitTests:
|
||||
needs: [ IdentifyBranches, CherryPickUnitTestMatrix ]
|
||||
if: ${{ needs.IdentifyBranches.outputs.branch_count > 0 && ( success() || failure() ) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check unit test matrix status
|
||||
env:
|
||||
RESULT: ${{needs.CherryPickUnitTestMatrix.result}}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
case $RESULT in
|
||||
success)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--add-label ${{vars.CHERRY_PICK_CHECKS_PASSED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::notice::All tests passed"
|
||||
exit 0
|
||||
;;
|
||||
skipped)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{vars.CHERRY_PICK_TESTING_IN_PROGRESS}} \
|
||||
--add-label ${{vars.CHERRY_PICK_CHECKS_FAILED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::notice::Unit tests were skipped because of an earlier failure"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{vars.CHERRY_PICK_TESTING_IN_PROGRESS}} \
|
||||
--add-label ${{vars.CHERRY_PICK_CHECKS_FAILED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::error::One or more tests failed ($RESULT)"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
CherryPickGateTestMatrix:
|
||||
needs: [ IdentifyBranches, CherryPickUnitTests ]
|
||||
if: ${{ success() }}
|
||||
continue-on-error: false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJSON(needs.IdentifyBranches.outputs.branches) }}
|
||||
group: ${{ fromJSON(vars.GATETEST_LIST) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run Gate Tests for ${{ matrix.group }}-${{matrix.branch}}
|
||||
uses: asterisk/asterisk-ci-actions/AsteriskGateComposite@main
|
||||
with:
|
||||
test_type: Gate
|
||||
asterisk_repo: ${{github.repository}}
|
||||
pr_number: ${{env.PR_NUMBER}}
|
||||
base_branch: ${{matrix.branch}}
|
||||
is_cherry_pick: true
|
||||
modules_blacklist: ${{env.MODULES_BLACKLIST}}
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
testsuite_repo: ${{vars.TESTSUITE_REPO}}
|
||||
gatetest_group: ${{matrix.group}}
|
||||
gatetest_commands: ${{vars.GATETEST_COMMANDS}}
|
||||
|
||||
CherryPickGateTests:
|
||||
needs: [ IdentifyBranches, CherryPickGateTestMatrix ]
|
||||
if: ${{ success() || failure() }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check test matrix status
|
||||
env:
|
||||
RESULT: ${{needs.CherryPickGateTestMatrix.result}}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{vars.CHERRY_PICK_TESTING_IN_PROGRESS}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
case $RESULT in
|
||||
success)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--add-label ${{vars.CHERRY_PICK_GATES_PASSED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::notice::All Testsuite tests passed"
|
||||
exit 0
|
||||
;;
|
||||
skipped)
|
||||
echo "::error::Testsuite tests were skipped because of an earlier failure"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--add-label ${{vars.CHERRY_PICK_GATES_FAILED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::error::One or more Testsuite tests failed ($RESULT)"
|
||||
exit 1
|
||||
esac
|
||||
@@ -0,0 +1,109 @@
|
||||
name: CreateDocs
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branches:
|
||||
description: "JSON array of branches: ['18','20'] (no spaces)"
|
||||
required: true
|
||||
type: string
|
||||
schedule:
|
||||
# Times are UTC
|
||||
- cron: '0 04 * * *'
|
||||
|
||||
env:
|
||||
ASTERISK_REPO: ${{ github.repository }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
CreateDocsDebug:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: DumpEnvironment
|
||||
uses: asterisk/asterisk-ci-actions/DumpEnvironmentAction@main
|
||||
with:
|
||||
action-vars: ${{toJSON(inputs)}}
|
||||
|
||||
CreateDocsScheduledMatrix:
|
||||
needs: [ CreateDocsDebug ]
|
||||
if: ${{github.event_name == 'schedule' && fromJSON(vars.WIKIDOCS_ENABLE) == true }}
|
||||
continue-on-error: false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJSON(vars.WIKIDOC_BRANCHES) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: CreateDocs for ${{matrix.branch}}
|
||||
uses: asterisk/asterisk-ci-actions/CreateAsteriskDocsComposite@main
|
||||
with:
|
||||
asterisk_repo: ${{env.ASTERISK_REPO}}
|
||||
base_branch: ${{matrix.branch}}
|
||||
docs_dir: docs_dir/${{matrix.branch}}
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
CreateDocsScheduled:
|
||||
needs: [ CreateDocsScheduledMatrix ]
|
||||
if: ${{ success() || failure() }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check CreateDocsScheduledMatrix status
|
||||
env:
|
||||
RESULT: ${{needs.CreateDocsScheduledMatrix.result}}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
case $RESULT in
|
||||
success)
|
||||
echo "::notice::Docs created"
|
||||
exit 0
|
||||
;;
|
||||
skipped)
|
||||
echo "::notice::Skipped"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "::error::One or CreateDocs failed ($RESULT)"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
CreateDocsManualMatrix:
|
||||
needs: [ CreateDocsDebug ]
|
||||
if: ${{github.event_name == 'workflow_dispatch'}}
|
||||
continue-on-error: false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJSON(inputs.branches) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: CreateDocs for ${{matrix.branch}}
|
||||
uses: asterisk/asterisk-ci-actions/CreateAsteriskDocsComposite@main
|
||||
with:
|
||||
asterisk_repo: ${{env.ASTERISK_REPO}}
|
||||
base_branch: ${{matrix.branch}}
|
||||
docs_dir: docs_dir/${{matrix.branch}}
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
CreateDocsManual:
|
||||
needs: [ CreateDocsManualMatrix ]
|
||||
if: ${{ success() || failure() }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check CreateDocsManualMatrix status
|
||||
env:
|
||||
RESULT: ${{needs.CreateDocsManualMatrix.result}}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
case $RESULT in
|
||||
success)
|
||||
echo "::notice::Docs created"
|
||||
exit 0
|
||||
;;
|
||||
skipped)
|
||||
echo "::notice::Skipped"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "::error::One or CreateDocs failed ($RESULT)"
|
||||
exit 1
|
||||
esac
|
||||
@@ -0,0 +1,15 @@
|
||||
name: Issue Opened
|
||||
run-name: "Issue ${{github.event.number}} ${{github.event.action}} by ${{github.actor}}"
|
||||
on:
|
||||
issues:
|
||||
types: opened
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: initial labeling
|
||||
uses: andymckay/labeler@master
|
||||
with:
|
||||
add-labels: "triage"
|
||||
ignore-if-labeled: true
|
||||
@@ -0,0 +1,190 @@
|
||||
name: MergeApproved
|
||||
run-name: "Merge Approved for PR ${{github.event.number}}"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [labeled]
|
||||
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.number }}
|
||||
BASE_BRANCH: ${{github.event.pull_request.base.ref}}
|
||||
MODULES_BLACKLIST: ${{ vars.GATETEST_MODULES_BLACKLIST }} ${{ vars.UNITTEST_MODULES_BLACKLIST }}
|
||||
FORCE: ${{ endsWith(github.event.label.name, '-force') }}
|
||||
|
||||
jobs:
|
||||
IdentifyBranches:
|
||||
if: contains(fromJSON(vars.MERGE_APPROVED_LABELS), github.event.label.name)
|
||||
outputs:
|
||||
branches: ${{ steps.getbranches.outputs.branches }}
|
||||
all_branches: ${{ steps.checkbranches.outputs.all_branches }}
|
||||
branch_count: ${{ steps.getbranches.outputs.branch_count }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clean up labels
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{github.event.label.name}} \
|
||||
--remove-label ${{vars.PRE_MERGE_CHECKS_PASSED_LABEL}} \
|
||||
--remove-label ${{vars.PRE_MERGE_CHECKS_FAILED_LABEL}} \
|
||||
--remove-label ${{vars.PRE_MERGE_GATES_PASSED_LABEL}} \
|
||||
--remove-label ${{vars.PRE_MERGE_GATES_FAILED_LABEL}} \
|
||||
--remove-label ${{vars.PRE_MERGE_TESTING_IN_PROGRESS}} \
|
||||
${{env.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
|
||||
id: checkbranches
|
||||
env:
|
||||
BRANCH_COUNT: ${{ steps.getbranches.outputs.branch_count }}
|
||||
BRANCHES: ${{ steps.getbranches.outputs.branches }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--add-label ${{vars.PRE_MERGE_TESTING_IN_PROGRESS}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
all_branches=$(echo "$BRANCHES" | jq -c "[ \"$BASE_BRANCH\" ] + .")
|
||||
echo "all_branches=${all_branches}" >>${GITHUB_OUTPUT}
|
||||
|
||||
- name: Pre Check Cherry-Picks
|
||||
if: ${{ steps.getbranches.outputs.branch_count > 0 }}
|
||||
uses: asterisk/asterisk-ci-actions/CherryPick@main
|
||||
with:
|
||||
repo: ${{github.repository}}
|
||||
pr_number: ${{env.PR_NUMBER}}
|
||||
branches: ${{steps.getbranches.outputs.branches}}
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
push: false
|
||||
|
||||
PreMergeUnitTestMatrix:
|
||||
needs: [ IdentifyBranches ]
|
||||
if: success()
|
||||
continue-on-error: false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJSON(needs.IdentifyBranches.outputs.all_branches) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run Unit Tests for branch ${{matrix.branch}}
|
||||
uses: asterisk/asterisk-ci-actions/AsteriskUnitComposite@main
|
||||
with:
|
||||
asterisk_repo: ${{github.repository}}
|
||||
pr_number: ${{env.PR_NUMBER}}
|
||||
base_branch: ${{matrix.branch}}
|
||||
is_cherry_pick: true
|
||||
modules_blacklist: ${{env.MODULES_BLACKLIST}}
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
unittest_command: ${{vars.UNITTEST_COMMAND}}
|
||||
|
||||
PreMergeUnitTests:
|
||||
needs: [ IdentifyBranches, PreMergeUnitTestMatrix ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check unit test matrix status
|
||||
env:
|
||||
RESULT: ${{needs.PreMergeUnitTestMatrix.result}}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
case $RESULT in
|
||||
success)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{vars.PRE_MERGE_TESTING_IN_PROGRESS}} \
|
||||
--add-label ${{vars.PRE_MERGE_CHECKS_PASSED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::notice::All tests passed"
|
||||
exit 0
|
||||
;;
|
||||
skipped)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{vars.PRE_MERGE_TESTING_IN_PROGRESS}} \
|
||||
--add-label ${{vars.PRE_MERGE_CHECKS_FAILED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::notice::Unit tests were skipped because of an earlier failure"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{vars.PRE_MERGE_TESTING_IN_PROGRESS}} \
|
||||
--add-label ${{vars.PRE_MERGE_CHECKS_FAILED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::error::One or more tests failed ($RESULT)"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
MergeAndCherryPick:
|
||||
needs: [ IdentifyBranches, PreMergeUnitTests ]
|
||||
if: success()
|
||||
concurrency:
|
||||
group: MergeAndCherryPick
|
||||
cancel-in-progress: false
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Start Merge
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--add-label ${{vars.MERGE_IN_PROGRESS_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
|
||||
- name: Get Token needed to push cherry-picks
|
||||
id: get_workflow_token
|
||||
uses: peter-murray/workflow-application-token-action@v1
|
||||
with:
|
||||
application_id: ${{secrets.ASTERISK_ORG_ACCESS_APP_ID}}
|
||||
application_private_key: ${{secrets.ASTERISK_ORG_ACCESS_APP_PRIV_KEY}}
|
||||
organization: asterisk
|
||||
|
||||
- name: Merge and Cherry Pick to ${{needs.IdentifyBranches.outputs.branches}}
|
||||
id: mergecp
|
||||
uses: asterisk/asterisk-ci-actions/MergeAndCherryPickComposite@main
|
||||
with:
|
||||
repo: ${{github.repository}}
|
||||
pr_number: ${{env.PR_NUMBER}}
|
||||
branches: ${{needs.IdentifyBranches.outputs.branches}}
|
||||
force: ${{env.FORCE}}
|
||||
github_token: ${{steps.get_workflow_token.outputs.token}}
|
||||
|
||||
- name: Merge Cleanup
|
||||
if: always()
|
||||
env:
|
||||
RESULT: ${{ steps.mergecp.outcome }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BRANCH_COUNT: ${{ needs.IdentifyBranches.outputs.branch_count }}
|
||||
BRANCHES: ${{ needs.IdentifyBranches.outputs.branches }}
|
||||
|
||||
run: |
|
||||
case $RESULT in
|
||||
success)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{vars.MERGE_IN_PROGRESS_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
if [ $BRANCH_COUNT -eq 0 ] ; then
|
||||
gh pr comment --repo ${{github.repository}} \
|
||||
-b "Successfully merged to branch $BASE_BRANCH." \
|
||||
${{env.PR_NUMBER}} || :
|
||||
else
|
||||
gh pr comment --repo ${{github.repository}} \
|
||||
-b "Successfully merged to branch $BASE_BRANCH and cherry-picked to $BRANCHES" \
|
||||
${{env.PR_NUMBER}} || :
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
failure)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{vars.MERGE_IN_PROGRESS_LABEL}} \
|
||||
--add-label ${{vars.MERGE_FAILED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
@@ -0,0 +1,28 @@
|
||||
name: Nightly Admin
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
env:
|
||||
ASTERISK_REPO: ${{ github.repository }}
|
||||
PR_NUMBER: 0
|
||||
PR_COMMIT: ''
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
MODULES_BLACKLIST: ${{ vars.GATETEST_MODULES_BLACKLIST }} ${{ vars.UNITTEST_MODULES_BLACKLIST }}
|
||||
|
||||
jobs:
|
||||
CloseStaleIssues:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Close Stale Issues
|
||||
uses: actions/stale@v7
|
||||
with:
|
||||
stale-issue-message: 'This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
|
||||
stale-issue-label: stale
|
||||
close-issue-message: 'This issue was closed because it has been stalled for 14 days with no activity.'
|
||||
days-before-stale: 7
|
||||
days-before-close: 14
|
||||
days-before-pr-close: -1
|
||||
only-labels: triage,feedback-required
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
name: NightlyTests
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
schedule:
|
||||
- cron: '0 2 * * *'
|
||||
|
||||
env:
|
||||
ASTERISK_REPO: ${{ github.repository }}
|
||||
PR_NUMBER: 0
|
||||
PR_COMMIT: ''
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
MODULES_BLACKLIST: ${{ vars.GATETEST_MODULES_BLACKLIST }}
|
||||
|
||||
jobs:
|
||||
AsteriskNightly:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJSON(vars.NIGHTLYTEST_BRANCHES) }}
|
||||
group: ${{ fromJSON(vars.NIGHTLYTEST_LIST) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run Nightly Tests for ${{ matrix.group }}/${{ matrix.branch }}
|
||||
uses: asterisk/asterisk-ci-actions/AsteriskGateComposite@main
|
||||
with:
|
||||
test_type: Nightly
|
||||
asterisk_repo: ${{env.ASTERISK_REPO}}
|
||||
pr_number: ${{env.PR_NUMBER}}
|
||||
base_branch: ${{matrix.branch}}
|
||||
modules_blacklist: ${{env.MODULES_BLACKLIST}}
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
testsuite_repo: ${{vars.TESTSUITE_REPO}}
|
||||
gatetest_group: ${{matrix.group}}
|
||||
gatetest_commands: ${{vars.GATETEST_COMMANDS}}
|
||||
|
||||
AsteriskNightlyTests:
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: AsteriskNightly
|
||||
steps:
|
||||
- name: Check test matrix status
|
||||
env:
|
||||
RESULT: ${{needs.AsteriskNightly.result}}
|
||||
run: |
|
||||
case $RESULT in
|
||||
success)
|
||||
echo "::notice::All Testsuite tests passed"
|
||||
exit 0
|
||||
;;
|
||||
skipped)
|
||||
echo "::error::Testsuite tests were skipped because of an earlier failure"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "::error::One or more Testsuite tests failed"
|
||||
exit 1
|
||||
esac
|
||||
@@ -0,0 +1,32 @@
|
||||
name: PRMerged
|
||||
run-name: "PR ${{github.event.number || inputs.pr_number}} ${{github.event.action || 'MANUAL POST MERGE'}} by ${{ github.actor }}"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [closed]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pr_number:
|
||||
description: 'PR number'
|
||||
required: true
|
||||
type: number
|
||||
|
||||
concurrency:
|
||||
group: ${{github.workflow}}-${{github.event.number || inputs.pr_number}}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
REPO: ${{github.repository}}
|
||||
PR_NUMBER: ${{github.event.number || inputs.pr_number}}
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
jobs:
|
||||
CloseIssues:
|
||||
if: github.event.pull_request.merged == true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/auto-close-fixed-issues@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
name: PROpenedOrUpdated
|
||||
run-name: "PR ${{github.event.number}} ${{github.event.action}} by ${{ github.actor }}"
|
||||
on:
|
||||
# workflow_dispatch:
|
||||
pull_request_target:
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
env:
|
||||
ASTERISK_REPO: ${{github.repository}}
|
||||
PR_NUMBER: ${{github.event.number}}
|
||||
PR_COMMIT: ${{github.event.pull_request.head.sha}}
|
||||
BRANCH: ${{github.event.pull_request.base.ref}}
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
MODULES_BLACKLIST: ${{vars.GATETEST_MODULES_BLACKLIST}} ${{vars.UNITTEST_MODULES_BLACKLIST}}
|
||||
|
||||
jobs:
|
||||
|
||||
PROpenUpdateUnitTests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get Token needed to add reviewers
|
||||
if: github.event.action == 'opened'
|
||||
id: get_workflow_token
|
||||
uses: peter-murray/workflow-application-token-action@v1
|
||||
with:
|
||||
application_id: ${{secrets.ASTERISK_ORG_ACCESS_APP_ID}}
|
||||
application_private_key: ${{secrets.ASTERISK_ORG_ACCESS_APP_PRIV_KEY}}
|
||||
organization: asterisk
|
||||
|
||||
- name: Add cherry-pick reminder and reviewers
|
||||
if: github.event.action == 'opened'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{steps.get_workflow_token.outputs.token}}
|
||||
GH_TOKEN: ${{steps.get_workflow_token.outputs.token}}
|
||||
CHERRY_PICK_REMINDER: ${{vars.CHERRY_PICK_REMINDER}}
|
||||
REVIEWERS: ${{vars.PR_REVIEWERS}}
|
||||
run: |
|
||||
IFS=$'; \n'
|
||||
for r in $REVIEWERS ; do
|
||||
echo "Adding reviewer $r"
|
||||
gh pr edit --repo ${{github.repository}} ${PR_NUMBER} --add-reviewer $r || :
|
||||
done
|
||||
# If there's already a reminder comment, don't add another one.
|
||||
ADD_COMMENT=true
|
||||
# This query will FAIL if it finds the comment.
|
||||
gh pr view --repo ${{github.repository}} --json comments \
|
||||
--jq '.comments[].body | select(. | startswith("<!--CPR-->")) | halt_error(1)' \
|
||||
${{env.PR_NUMBER}} >/dev/null 2>&1 || ADD_COMMENT=false
|
||||
if $ADD_COMMENT ; then
|
||||
echo "Adding CPR comment"
|
||||
gh pr comment --repo ${{github.repository}} \
|
||||
-b "${CHERRY_PICK_REMINDER}" ${{env.PR_NUMBER}}
|
||||
else
|
||||
echo "CPR comment already present"
|
||||
fi
|
||||
|
||||
- name: Set Labels
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{vars.TEST_CHECKS_PASSED_LABEL}} \
|
||||
--remove-label ${{vars.TEST_CHECKS_FAILED_LABEL}} \
|
||||
--remove-label ${{vars.TEST_GATES_PASSED_LABEL}} \
|
||||
--remove-label ${{vars.TEST_GATES_FAILED_LABEL}} \
|
||||
--remove-label ${{vars.CHERRY_PICK_CHECKS_PASSED_LABEL}} \
|
||||
--remove-label ${{vars.CHERRY_PICK_CHECKS_FAILED_LABEL}} \
|
||||
--remove-label ${{vars.CHERRY_PICK_GATES_PASSED_LABEL}} \
|
||||
--remove-label ${{vars.CHERRY_PICK_GATES_FAILED_LABEL}} \
|
||||
--add-label ${{vars.TESTING_IN_PROGRESS}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
|
||||
- name: Run Unit Tests
|
||||
uses: asterisk/asterisk-ci-actions/AsteriskUnitComposite@main
|
||||
with:
|
||||
asterisk_repo: ${{env.ASTERISK_REPO}}
|
||||
pr_number: ${{env.PR_NUMBER}}
|
||||
base_branch: ${{env.BRANCH}}
|
||||
modules_blacklist: ${{env.MODULES_BLACKLIST}}
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
unittest_command: ${{vars.UNITTEST_COMMAND}}
|
||||
|
||||
- name: Add Checks Passed Label
|
||||
if: ${{ success() }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--add-label ${{vars.TEST_CHECKS_PASSED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
|
||||
PROpenUpdateGateTestMatrix:
|
||||
needs: PROpenUpdateUnitTests
|
||||
continue-on-error: false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
group: ${{ fromJSON(vars.GATETEST_LIST) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: runtest
|
||||
name: Run Gate Tests for ${{ matrix.group }}
|
||||
uses: asterisk/asterisk-ci-actions/AsteriskGateComposite@main
|
||||
with:
|
||||
test_type: Gate
|
||||
asterisk_repo: ${{env.ASTERISK_REPO}}
|
||||
pr_number: ${{env.PR_NUMBER}}
|
||||
base_branch: ${{env.BRANCH}}
|
||||
modules_blacklist: ${{env.MODULES_BLACKLIST}}
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
testsuite_repo: ${{vars.TESTSUITE_REPO}}
|
||||
gatetest_group: ${{matrix.group}}
|
||||
gatetest_commands: ${{vars.GATETEST_COMMANDS}}
|
||||
|
||||
|
||||
PROpenUpdateGateTests:
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
needs: PROpenUpdateGateTestMatrix
|
||||
steps:
|
||||
- name: Check test matrix status
|
||||
env:
|
||||
RESULT: ${{ needs.PROpenUpdateGateTestMatrix.result }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
echo "all results: ${{ toJSON(needs.*.result) }}"
|
||||
echo "composite result: $RESULT"
|
||||
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--remove-label ${{vars.TESTING_IN_PROGRESS}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
|
||||
case $RESULT in
|
||||
success)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--add-label ${{vars.TEST_GATES_PASSED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::notice::All Testsuite tests passed"
|
||||
exit 0
|
||||
;;
|
||||
skipped)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--add-label ${{vars.TEST_CHECKS_FAILED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::error::Testsuite tests were skipped because of an earlier failure"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
gh pr edit --repo ${{github.repository}} \
|
||||
--add-label ${{vars.TEST_GATES_FAILED_LABEL}} \
|
||||
${{env.PR_NUMBER}} || :
|
||||
echo "::error::One or more Testsuite tests failed ($RESULT)"
|
||||
exit 1
|
||||
esac
|
||||
Reference in New Issue
Block a user