Skip to content

Commit

Permalink
chore: brew acceptance test
Browse files Browse the repository at this point in the history
* chore: Add cmds-to-test.sh with executable permissions

Co-authored-by: chsingh <chsingh@twilio.com>
  • Loading branch information
charan678 and charan678 committed Feb 16, 2022
1 parent 14c3cf5 commit 88e6f4b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 58 deletions.
11 changes: 11 additions & 0 deletions .github/scripts/cmds-to-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "Testing these commands for verification of installations"
echo "1. twilio --version"
twilio --version
echo "2. twilio api:core:addresses:list --help"
twilio api:core:addresses:list --help
echo "3. twilio profiles:list"
twilio profiles:list
echo "4. twilio help"
twilio help
echo "5. twilio api:core:calls --help"
twilio api:core:calls --help
63 changes: 43 additions & 20 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,58 @@ jobs:
git fetch --prune --unshallow
echo "::set-output name=TAG_NAME::$(git describe --tags $(git rev-list --tags --max-count=1))"
wait-for-oclif-releases:
name: Wait for oclif platform executables Release to complete
runs-on: ubuntu-latest
wait-for-brew-releases:
name: Wait for brew Release to complete
runs-on: macos-11
continue-on-error: true
needs: [ get-branch, get-tag ]
strategy:
matrix:
node-version: [ 16.x, 14.x, 10.x ]
outputs:
FAILURE_TAG_OCLIF: ${{ steps.failure_oclif.outputs.FAILURE_TAG_OCLIF }}
FAILURE_TAG_BREW: ${{ steps.failure_brew.outputs.FAILURE_TAG_BREW }}
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
- name: Wait for Oclif Release
- name: Wait for oclif executables Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: oclif-release.yml
INPUT_REF: ${{ needs.get-branch.outputs.branch }}
- name: Perform install and test on binaries
id: oclif_acceptance_run
- name: Global - Testing installation of Twilio CLI (1)
if: ${{ github.respository != 'twilio/draft-release-branch' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_NAME: ${{ github.repository_owner }}
run: |
gh release download ${{ needs.get-tag.outputs.TAG_NAME }} --pattern '*.deb'
sudo dpkg -i twilio-${{ needs.get-tag.outputs.TAG_NAME }}.deb
ls
twilio --version
twilio api --help
- name: setup oclif failure output
brew tap $REPO_NAME/brew && brew install twilio
./.github/scripts/cmds-to-test.sh
- name: Global - Testing upgrade Twilio CLI (2)
if: ${{ github.respository != 'twilio/draft-release-branch' }}
env:
REPO_NAME: ${{ github.repository_owner }}
run: |
brew tap $REPO_NAME/brew && brew install twilio
brew upgrade twilio
./.github/scripts/cmds-to-test.sh
- name: Draft - Testing installation of Twilio CLI (1)
if: ${{ github.respository == 'twilio/draft-release-branch' }}
env:
REPO_NAME: ${{ github.repository_owner }}
run: |
brew tap $REPO_NAME/brew && brew install twiliodraft
./.github/scripts/cmds-to-test.sh
- name: Draft - Testing upgrade Twilio CLI (2)
if: ${{ github.respository == 'twilio/draft-release-branch' }}
env:
REPO_NAME: ${{ github.repository_owner }}
run: |
brew tap $REPO_NAME/brew && brew install twiliodraft
brew upgrade twilio
./.github/scripts/cmds-to-test.sh
- name: setup brew failure output
if: failure() || cancelled()
id: failure_oclif
run: echo '::set-output name=FAILURE_TAG_OCLIF::true'
id: failure_brew
run: echo '::set-output name=FAILURE_TAG_BREW::true'

wait-for-windows-releases:
name: Wait for windows platform executables Release to complete
Expand Down Expand Up @@ -166,7 +189,7 @@ jobs:
if: failure() || cancelled()
id: failure_debian
run: echo '::set-output name=FAILURE_TAG_DEBIAN::true'

test-scoop-release:
name: Do scoop testing after release
runs-on: windows-latest
Expand Down Expand Up @@ -197,10 +220,10 @@ jobs:
run: echo '::set-output name=FAILURE_TAG_SCOOP::true'

notify-complete-fail:
needs: [wait-for-oclif-releases, wait-for-windows-releases, wait-for-debian-releases, wait-for-macos-releases]
needs: [wait-for-brew-releases, wait-for-windows-releases, wait-for-debian-releases, wait-for-macos-releases, test-scoop-release]
name: Notify Release Failed
runs-on: ubuntu-latest
if: ${{ ( needs.wait-for-macos-releases.outputs.FAILURE_TAG_MACOS == 'true' ) || ( needs.wait-for-windows-releases.outputs.FAILURE_TAG_WINDOWS == 'true' ) || ( needs.wait-for-oclif-releases.outputs.FAILURE_TAG_OCLIF == 'true' ) || ( needs.wait-for-debian-releases.outputs.FAILURE_TAG_DEBIAN == 'true') || ( needs.test-scoop-release.outputs.FAILURE_TAG_SCOOP == 'true') }}
if: ${{ ( needs.wait-for-macos-releases.outputs.FAILURE_TAG_MACOS == 'true' ) || ( needs.wait-for-windows-releases.outputs.FAILURE_TAG_WINDOWS == 'true' ) || ( needs.wait-for-brew-releases.outputs.FAILURE_TAG_BREW == 'true' ) || ( needs.wait-for-debian-releases.outputs.FAILURE_TAG_DEBIAN == 'true') || ( needs.test-scoop-release.outputs.FAILURE_TAG_SCOOP == 'true') }}
steps:
- uses: actions/checkout@v2
- name: Slack Notification
Expand All @@ -213,6 +236,6 @@ jobs:
SLACK_TITLE: "Twilio Cli"
SLACK_MESSAGE: 'CLI acceptance workflow Failed'
- name: Fail in case all jobs failed
if: ${{ ( needs.wait-for-macos-releases.outputs.FAILURE_TAG_MACOS == 'true' ) && ( needs.wait-for-windows-releases.outputs.FAILURE_TAG_WINDOWS == 'true' ) && ( needs.wait-for-oclif-releases.outputs.FAILURE_TAG_OCLIF == 'true' ) && ( needs.wait-for-debian-releases.outputs.FAILURE_TAG_DEBIAN == 'true') && ( needs.test-scoop-release.outputs.FAILURE_TAG_SCOOP == 'true')}}
if: ${{ ( needs.wait-for-brew-releases.outputs.FAILURE_TAG_BREW == 'true' ) && ( needs.wait-for-macos-releases.outputs.FAILURE_TAG_MACOS == 'true' ) && ( needs.wait-for-windows-releases.outputs.FAILURE_TAG_WINDOWS == 'true' ) && ( needs.wait-for-debian-releases.outputs.FAILURE_TAG_DEBIAN == 'true') && ( needs.test-scoop-release.outputs.FAILURE_TAG_SCOOP == 'true')}}
run:
exit 1
29 changes: 0 additions & 29 deletions .github/workflows/cli-test-homebrew.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,6 @@ jobs:
check-name: 'Oclif Release'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Run sanity testing on release-draft
if: ${{ github.event.inputs.draft-release == 'true' }}
run: node .github/scripts/trigger-workflow.js
env:
WORKFLOW_NAME: '.github/workflows/cli-test-homebrew.yml'
REPO_NAME: ${{ github.repository }}
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
BRANCH_NAME: ${{steps.extract_branch.outputs.branch}}
INPUTS: '{ "version": "${{ steps.semantic-release-draft.outputs.TAG_NAME }}" }'
delete-draft-release-oclif:
runs-on: ubuntu-latest
if: ${{github.event.inputs.draft-release == 'true'}}
Expand Down

0 comments on commit 88e6f4b

Please sign in to comment.