Skip to content

Commit

Permalink
Add on-failure workflow to test and deploy (#19)
Browse files Browse the repository at this point in the history
* Add on-failure workflow to test and deploy

* Updated secret

* Updated slack hook to always fire

* Updated slack hook to always fire

* Changed cron job to run every 10 mins

* Change to run when not scheduled

* Notify only on failure, add a test that always fails
  • Loading branch information
IgorTatarnikov authored Nov 6, 2024
1 parent dc35e8d commit e4eb2bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- '*'
schedule:
# Runs at 6:10am UTC on Monday
- cron: '10 6 * * 1'
- cron: '0/10 * * * *'
pull_request:

jobs:
Expand Down Expand Up @@ -60,6 +60,19 @@ jobs:
python-version: ${{ matrix.python-version }}
secret-codecov-token: ${{ secrets.CODECOV_TOKEN }}

on-failure:
name: Notify slack on scheduled failure
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: ravsamhq/notify-slack-action@v2
if: ${{ github.event_name == 'schedule' }}
with:
status: ${{ job.status }} # required
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFYBOT_WEBHOOK_URL }} # required

build_sdist_wheels:
name: Build source distribution
needs: [test]
Expand Down
4 changes: 4 additions & 0 deletions tests/test_unit/test_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ def test_tile_init():
assert tile.channel_name == ""
assert tile.illumination_id == illumination_id
assert tile.angle == angle


def test_always_fail():
assert False

0 comments on commit e4eb2bb

Please sign in to comment.