Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 79 additions & 3 deletions .github/workflows/tests.yml → .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run all the unit tests
name: Python CI

on:
push:
Expand All @@ -9,8 +9,46 @@ on:
- cron: "0 0 * * *"
workflow_dispatch:

env:
LATEST_SUPPORTED_PY: "3.14"
Comment on lines +12 to +13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥧 praise: Yum!


jobs:
build:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Set up Python ${{ env.LATEST_SUPPORTED_PY }}
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ env.LATEST_SUPPORTED_PY }}
- name: Run lint verification
run: ./scripts/lint.sh

typecheck:
name: Typecheck
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Set up Python ${{ env.LATEST_SUPPORTED_PY }}
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ env.LATEST_SUPPORTED_PY }}
- name: Run mypy verification
run: ./scripts/run_mypy.sh

unittest:
name: Unit tests
runs-on: ubuntu-22.04
timeout-minutes: 10
strategy:
Expand Down Expand Up @@ -85,10 +123,48 @@ jobs:
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

codecov:
name: Code Coverage
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
env:
BOLT_PYTHON_CODECOV_RUNNING: "1"
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Set up Python ${{ env.LATEST_SUPPORTED_PY }}
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ env.LATEST_SUPPORTED_PY }}
- name: Install dependencies
run: |
pip install -U pip
pip install .
pip install -r requirements/adapter.txt
pip install -r requirements/testing.txt
pip install -r requirements/adapter_testing.txt
- name: Run all tests for codecov
run: |
pytest --cov=./slack_bolt/ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
fail_ci_if_error: true
report_type: coverage
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

notifications:
name: Regression notifications
runs-on: ubuntu-latest
needs: build
needs:
- lint
- typecheck
- unittest
if: ${{ !success() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' }}
steps:
- name: Send notifications of failing tests
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/codecov.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/flake8.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/mypy.yml

This file was deleted.

7 changes: 5 additions & 2 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
script_dir=`dirname $0`
cd ${script_dir}/..

pip install -U pip
pip install -U -r requirements/tools.txt
if [[ "$1" != "--no-install" ]]; then
export PIP_REQUIRE_VIRTUALENV=1
pip install -U pip
pip install -U -r requirements/tools.txt
fi

black slack_bolt/ tests/
27 changes: 11 additions & 16 deletions scripts/install_all_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,20 @@ pip uninstall python-lambda
test_target="$1"

pip install -U -e .
pip install -U -r requirements/testing.txt
pip install -U -r requirements/adapter.txt
pip install -U -r requirements/adapter_testing.txt
pip install -U -r requirements/tools.txt
# To avoid errors due to the old versions of click forced by Chalice
pip install -U pip click

if [[ $test_target != "" ]]
then
pip install -U -r requirements/testing.txt && \
pip install -U -r requirements/adapter.txt && \
pip install -U -r requirements/adapter_testing.txt && \
# To avoid errors due to the old versions of click forced by Chalice
pip install -U pip click && \
black slack_bolt/ tests/ && \
./scripts/format.sh --no-install
pytest $1
else
pip install -U -r requirements/testing.txt && \
pip install -U -r requirements/adapter.txt && \
pip install -U -r requirements/adapter_testing.txt && \
pip install -r requirements/tools.txt && \
# To avoid errors due to the old versions of click forced by Chalice
pip install -U pip click && \
black slack_bolt/ tests/ && \
flake8 slack_bolt/ && flake8 examples/
pytest && \
mypy --config-file pyproject.toml
./scripts/format.sh --no-install
./scripts/lint.sh --no-install
pytest
./scripts/run_mypy.sh --no-install
fi
12 changes: 12 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# ./scripts/lint.sh

script_dir=$(dirname $0)
cd ${script_dir}/..

if [[ "$1" != "--no-install" ]]; then
pip install -U pip
pip install -U -r requirements/tools.txt
fi

flake8 slack_bolt/ && flake8 examples/
7 changes: 0 additions & 7 deletions scripts/run_flake8.sh

This file was deleted.

15 changes: 10 additions & 5 deletions scripts/run_mypy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
# ./scripts/run_mypy.sh

script_dir=$(dirname $0)
cd ${script_dir}/.. && \
cd ${script_dir}/..

if [[ "$1" != "--no-install" ]]; then
pip install -U pip
pip install -U .
pip install -U -r requirements/async.txt && \
pip install -U -r requirements/adapter.txt && \
pip install -U -r requirements/tools.txt && \
mypy --config-file pyproject.toml
pip install -U -r requirements/async.txt
pip install -U -r requirements/adapter.txt
pip install -U -r requirements/tools.txt
fi

mypy --config-file pyproject.toml
8 changes: 4 additions & 4 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ script_dir=`dirname $0`
cd ${script_dir}/..

test_target="$1"
python_version=`python --version | awk '{print $2}'`

./scripts/format.sh --no-install

if [[ $test_target != "" ]]
then
black slack_bolt/ tests/ && \
pytest -vv $1
pytest -vv $1
else
black slack_bolt/ tests/ && pytest
pytest
fi