Skip to content

chore: Added tests and sonarcloud scan while adding the PR's #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/cli-core-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Cli Core Tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Can you format the PR title to the required format? It throws up everytime I run something on Librarian. You'll have to mention if it's a fix or feature or whatever is suitable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

on:
push:
branches: [ main ]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [16.x, 14.x, 10.x]
steps:
- name: Checkout cli core repo
uses: actions/checkout@v2
- run: npm install
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Run tests
run: npm test
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
notify-complete-fail:
if: ${{ failure() || cancelled() }}
needs: [ test, sonarcloud ]
name: Notify Test Failed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.ALERT_SLACK_WEB_HOOK }}
SLACK_COLOR: ${{ job.status }}
SLACK_USERNAME: CLI Github Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_ICON_EMOJI: ':github:'
SLACK_TITLE: "Twilio Cli Core"
SLACK_MESSAGE: 'Cli core tests failed'
MSG_MINIMAL: actions url
SLACK_FOOTER: Posted automatically using GitHub Actions