diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 57ad6b689..fe7251f57 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -19,7 +19,7 @@ You can hook `pyenv` into your shell automatically by running `pyenv init` and f Install necessary Python runtimes for development/testing. It is not necessary to install all the various Python versions we test in [continuous integration on -GitHub Actions](https://github.com/slackapi/python-slack-sdk/blob/main/.github/workflows/ci-build.yml), +GitHub Actions](https://github.com/slackapi/python-slack-sdk/blob/main/.github/workflows/tests.yml), but make sure you are running at least one version that we execute our tests in locally so that you can run the tests yourself. @@ -56,7 +56,7 @@ run `source env_3.9.6/bin/activate` again. The last step is to install this project's dependencies and run all unit tests; to do so, you can run ```bash -$ ./scripts/run_validation.sh +$ ./scripts/run_validation.sh ``` Also check out [how @@ -74,7 +74,7 @@ When you make changes to this SDK, please write unit tests verifying if the chan Run all the unit tests, code formatter, and code analyzer: ```bash -$ ./scripts/run_validation.sh +$ ./scripts/run_validation.sh ``` Run all the unit tests (no formatter nor code analyzer): diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml deleted file mode 100644 index fa5087fd1..000000000 --- a/.github/workflows/mypy.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: mypy validation - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 5 - strategy: - matrix: - python-version: ["3.13"] - permissions: - contents: read - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 - with: - python-version: ${{ matrix.python-version }} - - name: Run mypy verification - run: | - ./scripts/run_mypy.sh diff --git a/.github/workflows/ci-build.yml b/.github/workflows/tests.yml similarity index 63% rename from .github/workflows/ci-build.yml rename to .github/workflows/tests.yml index 841cb37ed..eca347fff 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/tests.yml @@ -1,14 +1,38 @@ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: CI Build +name: Test on: push: branches: - main pull_request: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: jobs: - build: + typecheck: + name: Typechecks + runs-on: ubuntu-latest + timeout-minutes: 5 + strategy: + matrix: + python-version: ["3.13"] + permissions: + contents: read + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + with: + python-version: ${{ matrix.python-version }} + - name: Run mypy verification + run: | + ./scripts/run_mypy.sh + unittest: + name: Unit tests runs-on: ubuntu-22.04 timeout-minutes: 15 strategy: @@ -68,3 +92,20 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} # Run validation generates the coverage file files: ./coverage.xml + notifications: + name: Regression notifications + runs-on: ubuntu-latest + needs: + - typecheck + - unittest + if: ${{ !success() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' }} + steps: + - name: Send notifications of failing tests + uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1 + with: + errors: true + webhook: ${{ secrets.SLACK_REGRESSION_FAILURES_WEBHOOK_URL }} + webhook-type: webhook-trigger + payload: | + action_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + repository: "${{ github.repository }}" diff --git a/README.md b/README.md index ec57ebfdc..3070399d9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@

Python Slack SDK

- - CI Build + + Tests Codecov