-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add daily npm install and test workflow (#74)
* Add daily unit test workflow Co-authored-by: Shazron Abdullah <shaz@adobe.com> Co-authored-by: Himavanth <contacthima@yahoo.com>
- Loading branch information
1 parent
3f402db
commit 4909581
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Daily - Do npm install and run all unit tests | ||
|
||
on: | ||
schedule: | ||
# run daily at midnight | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node: [14] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm i --package-lock --package-lock-only | ||
- run: npm ci | ||
- name: run unit tests | ||
run: npm run test | ||
- name: Slack Notification | ||
if: ${{ failure() }} | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_TITLE: 'Node version' | ||
SLACK_MESSAGE: ${{ matrix.node }} | ||
SLACK_COLOR: ${{ job.status == 'success' && 'good' || job.status == 'cancelled' && '#808080' || 'danger' }} | ||
|