Skip to content

Commit

Permalink
Add scheduled tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Jun 24, 2024
1 parent cfe2cd7 commit 154ef70
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Unit Test

on:
schedule:
- cron: '0 7 * * *'
push:
workflow_call:

Expand Down Expand Up @@ -28,3 +30,31 @@ jobs:
bundler-cache: true
- name: Run the test
run: bundle exec rake test spec

notify:
runs-on: ubuntu-latest
needs: test
if: always() && github.event_name == 'schedule'
steps:
- if: ${{ needs.test.result == 'success' }}
name: Notify on success
uses: slackapi/[email protected]
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
slack-message: |-
:github: ${{ github.repository }}: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
:github-check: ${{ github.ref_type }}: ${{ github.ref_name }}
- if: ${{ needs.test.result == 'failure' }}
name: Notify on failure
uses: slackapi/[email protected]
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
slack-message: |-
:github: ${{ github.repository }}: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
:red-light: ${{ github.ref_type }}: ${{ github.ref_name }}

0 comments on commit 154ef70

Please sign in to comment.