|
1 | | -name: Run all the unit tests |
| 1 | +name: Python CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
9 | 9 | - cron: "0 0 * * *" |
10 | 10 | workflow_dispatch: |
11 | 11 |
|
| 12 | +env: |
| 13 | + LATEST_SUPPORTED_PY: "3.14" |
| 14 | + |
12 | 15 | jobs: |
13 | | - build: |
| 16 | + lint: |
| 17 | + name: Lint |
| 18 | + runs-on: ubuntu-latest |
| 19 | + timeout-minutes: 5 |
| 20 | + permissions: |
| 21 | + contents: read |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 24 | + with: |
| 25 | + persist-credentials: false |
| 26 | + - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} |
| 27 | + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 |
| 28 | + with: |
| 29 | + python-version: ${{ env.LATEST_SUPPORTED_PY }} |
| 30 | + - name: Run lint verification |
| 31 | + run: ./scripts/lint.sh |
| 32 | + |
| 33 | + typecheck: |
| 34 | + name: Typecheck |
| 35 | + runs-on: ubuntu-latest |
| 36 | + timeout-minutes: 5 |
| 37 | + permissions: |
| 38 | + contents: read |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 41 | + with: |
| 42 | + persist-credentials: false |
| 43 | + - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} |
| 44 | + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 |
| 45 | + with: |
| 46 | + python-version: ${{ env.LATEST_SUPPORTED_PY }} |
| 47 | + - name: Run mypy verification |
| 48 | + run: ./scripts/run_mypy.sh |
| 49 | + |
| 50 | + unittest: |
| 51 | + name: Unit tests |
14 | 52 | runs-on: ubuntu-22.04 |
15 | 53 | timeout-minutes: 10 |
16 | 54 | strategy: |
@@ -85,10 +123,48 @@ jobs: |
85 | 123 | report_type: test_results |
86 | 124 | token: ${{ secrets.CODECOV_TOKEN }} |
87 | 125 | verbose: true |
| 126 | + |
| 127 | + codecov: |
| 128 | + name: Code Coverage |
| 129 | + runs-on: ubuntu-latest |
| 130 | + timeout-minutes: 10 |
| 131 | + permissions: |
| 132 | + contents: read |
| 133 | + env: |
| 134 | + BOLT_PYTHON_CODECOV_RUNNING: "1" |
| 135 | + steps: |
| 136 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 137 | + with: |
| 138 | + persist-credentials: false |
| 139 | + - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} |
| 140 | + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 |
| 141 | + with: |
| 142 | + python-version: ${{ env.LATEST_SUPPORTED_PY }} |
| 143 | + - name: Install dependencies |
| 144 | + run: | |
| 145 | + pip install -U pip |
| 146 | + pip install . |
| 147 | + pip install -r requirements/adapter.txt |
| 148 | + pip install -r requirements/testing.txt |
| 149 | + pip install -r requirements/adapter_testing.txt |
| 150 | + - name: Run all tests for codecov |
| 151 | + run: | |
| 152 | + pytest --cov=./slack_bolt/ --cov-report=xml |
| 153 | + - name: Upload coverage to Codecov |
| 154 | + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 |
| 155 | + with: |
| 156 | + fail_ci_if_error: true |
| 157 | + report_type: coverage |
| 158 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 159 | + verbose: true |
| 160 | + |
88 | 161 | notifications: |
89 | 162 | name: Regression notifications |
90 | 163 | runs-on: ubuntu-latest |
91 | | - needs: build |
| 164 | + needs: |
| 165 | + - lint |
| 166 | + - typecheck |
| 167 | + - unittest |
92 | 168 | if: ${{ !success() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' }} |
93 | 169 | steps: |
94 | 170 | - name: Send notifications of failing tests |
|
0 commit comments