Skip to content

Commit e9e64d8

Browse files
authored
ci: send regression notifications if prior jobs do not succeed on schedule (#1768)
1 parent 344e0c5 commit e9e64d8

File tree

4 files changed

+48
-35
lines changed

4 files changed

+48
-35
lines changed

.github/maintainers_guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can hook `pyenv` into your shell automatically by running `pyenv init` and f
1919

2020
Install necessary Python runtimes for development/testing. It is not necessary
2121
to install all the various Python versions we test in [continuous integration on
22-
GitHub Actions](https://github.com/slackapi/python-slack-sdk/blob/main/.github/workflows/ci-build.yml),
22+
GitHub Actions](https://github.com/slackapi/python-slack-sdk/blob/main/.github/workflows/tests.yml),
2323
but make sure you are running at least one version that we execute our tests in
2424
locally so that you can run the tests yourself.
2525

@@ -56,7 +56,7 @@ run `source env_3.9.6/bin/activate` again.
5656
The last step is to install this project's dependencies and run all unit tests; to do so, you can run
5757

5858
```bash
59-
$ ./scripts/run_validation.sh
59+
$ ./scripts/run_validation.sh
6060
```
6161

6262
Also check out [how
@@ -74,7 +74,7 @@ When you make changes to this SDK, please write unit tests verifying if the chan
7474
Run all the unit tests, code formatter, and code analyzer:
7575

7676
```bash
77-
$ ./scripts/run_validation.sh
77+
$ ./scripts/run_validation.sh
7878
```
7979

8080
Run all the unit tests (no formatter nor code analyzer):

.github/workflows/mypy.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,38 @@
11
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
2-
name: CI Build
2+
name: Test
33

44
on:
55
push:
66
branches:
77
- main
88
pull_request:
9+
schedule:
10+
- cron: "0 0 * * *"
11+
workflow_dispatch:
912

1013
jobs:
11-
build:
14+
typecheck:
15+
name: Typechecks
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 5
18+
strategy:
19+
matrix:
20+
python-version: ["3.13"]
21+
permissions:
22+
contents: read
23+
steps:
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
with:
26+
persist-credentials: false
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Run mypy verification
32+
run: |
33+
./scripts/run_mypy.sh
34+
unittest:
35+
name: Unit tests
1236
runs-on: ubuntu-22.04
1337
timeout-minutes: 15
1438
strategy:
@@ -68,3 +92,20 @@ jobs:
6892
token: ${{ secrets.CODECOV_TOKEN }}
6993
# Run validation generates the coverage file
7094
files: ./coverage.xml
95+
notifications:
96+
name: Regression notifications
97+
runs-on: ubuntu-latest
98+
needs:
99+
- typecheck
100+
- unittest
101+
if: ${{ !success() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' }}
102+
steps:
103+
- name: Send notifications of failing tests
104+
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
105+
with:
106+
errors: true
107+
webhook: ${{ secrets.SLACK_REGRESSION_FAILURES_WEBHOOK_URL }}
108+
webhook-type: webhook-trigger
109+
payload: |
110+
action_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
111+
repository: "${{ github.repository }}"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<h1 align="center">Python Slack SDK</h1>
22

33
<p align="center">
4-
<a href="https://github.com/slackapi/python-slack-sdk/actions/workflows/ci-build.yml">
5-
<img alt="CI Build" src="https://img.shields.io/github/actions/workflow/status/slackapi/python-slack-sdk/ci-build.yml"></a>
4+
<a href="https://github.com/slackapi/python-slack-sdk/actions/workflows/tests.yml">
5+
<img alt="Tests" src="https://img.shields.io/github/actions/workflow/status/slackapi/python-slack-sdk/tests.yml"></a>
66
<a href="https://codecov.io/gh/slackapi/python-slack-sdk">
77
<img alt="Codecov" src="https://img.shields.io/codecov/c/gh/slackapi/python-slack-sdk"></a>
88
<a href="https://pepy.tech/project/slack-sdk">

0 commit comments

Comments
 (0)