From dae3ca09ccd0a3b2e24166e41323e9127e681af0 Mon Sep 17 00:00:00 2001 From: sandeep-paliwal Date: Tue, 7 Sep 2021 12:27:02 +0530 Subject: [PATCH 1/2] Create daily.yml --- .github/workflows/daily.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/workflows/daily.yml diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.github/workflows/daily.yml @@ -0,0 +1 @@ + From 1f2be03c78b371202085eb72e4561bda72e8a430 Mon Sep 17 00:00:00 2001 From: sandeep-paliwal Date: Tue, 7 Sep 2021 12:27:30 +0530 Subject: [PATCH 2/2] Add daily workflow --- .github/workflows/daily.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 8b13789..f90ffc5 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -1 +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' }}