forked from twilio/twilio-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.71 KB
/
cli-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: CLI Unit Tests
on:
push:
branches: [ main ]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [ 18.x, 16.x, 14.x]
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- run: make 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
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
if: (github.event_name == 'pull_request' || github.ref_type == 'branch') && !github.event.pull_request.head.repo.fork && matrix.node-version == '16.x'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
notify-complete-fail:
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
needs: [ test ]
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: 'danger'
SLACK_USERNAME: CLI Github Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_ICON_EMOJI: ':github:'
SLACK_TITLE: "Twilio Cli"
SLACK_MESSAGE: 'Cli tests failed'
MSG_MINIMAL: actions url
SLACK_FOOTER: Posted automatically using GitHub Actions