| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - name: Run all the unit tests | ||
| 1 | + name: Python CI | ||
| 2 | 2 | ||
| 3 | 3 | on: | |
| 4 | 4 | push: | |
@@ -9,8 +9,46 @@ on: | |||
| 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 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,10 @@ | |||
| 4 | 4 | script_dir=`dirname $0` | |
| 5 | 5 | cd ${script_dir}/.. | |
| 6 | 6 | ||
| 7 | - pip install -U pip | ||
| 8 | - pip install -U -r requirements/tools.txt | ||
| 7 | + if [[ "$1" != "--no-install" ]]; then | ||
| 8 | + export PIP_REQUIRE_VIRTUALENV=1 | ||
| 9 | + pip install -U pip | ||
| 10 | + pip install -U -r requirements/tools.txt | ||
| 11 | + fi | ||
| 9 | 12 | ||
| 10 | 13 | black slack_bolt/ tests/ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,25 +16,20 @@ pip uninstall python-lambda | |||
| 16 | 16 | test_target="$1" | |
| 17 | 17 | ||
| 18 | 18 | pip install -U -e . | |
| 19 | + pip install -U -r requirements/testing.txt | ||
| 20 | + pip install -U -r requirements/adapter.txt | ||
| 21 | + pip install -U -r requirements/adapter_testing.txt | ||
| 22 | + pip install -U -r requirements/tools.txt | ||
| 23 | + # To avoid errors due to the old versions of click forced by Chalice | ||
| 24 | + pip install -U pip click | ||
| 19 | 25 | ||
| 20 | 26 | if [[ $test_target != "" ]] | |
| 21 | 27 | then | |
| 22 | - pip install -U -r requirements/testing.txt && \ | ||
| 23 | - pip install -U -r requirements/adapter.txt && \ | ||
| 24 | - pip install -U -r requirements/adapter_testing.txt && \ | ||
| 25 | - # To avoid errors due to the old versions of click forced by Chalice | ||
| 26 | - pip install -U pip click && \ | ||
| 27 | - black slack_bolt/ tests/ && \ | ||
| 28 | + ./scripts/format.sh --no-install | ||
| 28 | 29 | pytest $1 | |
| 29 | 30 | else | |
| 30 | - pip install -U -r requirements/testing.txt && \ | ||
| 31 | - pip install -U -r requirements/adapter.txt && \ | ||
| 32 | - pip install -U -r requirements/adapter_testing.txt && \ | ||
| 33 | - pip install -r requirements/tools.txt && \ | ||
| 34 | - # To avoid errors due to the old versions of click forced by Chalice | ||
| 35 | - pip install -U pip click && \ | ||
| 36 | - black slack_bolt/ tests/ && \ | ||
| 37 | - flake8 slack_bolt/ && flake8 examples/ | ||
| 38 | - pytest && \ | ||
| 39 | - mypy --config-file pyproject.toml | ||
| 31 | + ./scripts/format.sh --no-install | ||
| 32 | + ./scripts/lint.sh --no-install | ||
| 33 | + pytest | ||
| 34 | + ./scripts/run_mypy.sh --no-install | ||
| 40 | 35 | fi | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,12 @@ | |||
| 1 | + #!/bin/bash | ||
| 2 | + # ./scripts/lint.sh | ||
| 3 | + | ||
| 4 | + script_dir=$(dirname $0) | ||
| 5 | + cd ${script_dir}/.. | ||
| 6 | + | ||
| 7 | + if [[ "$1" != "--no-install" ]]; then | ||
| 8 | + pip install -U pip | ||
| 9 | + pip install -U -r requirements/tools.txt | ||
| 10 | + fi | ||
| 11 | + | ||
| 12 | + flake8 slack_bolt/ && flake8 examples/ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,9 +2,14 @@ | |||
| 2 | 2 | # ./scripts/run_mypy.sh | |
| 3 | 3 | ||
| 4 | 4 | script_dir=$(dirname $0) | |
| 5 | - cd ${script_dir}/.. && \ | ||
| 5 | + cd ${script_dir}/.. | ||
| 6 | + | ||
| 7 | + if [[ "$1" != "--no-install" ]]; then | ||
| 8 | + pip install -U pip | ||
| 6 | 9 | pip install -U . | |
| 7 | - pip install -U -r requirements/async.txt && \ | ||
| 8 | - pip install -U -r requirements/adapter.txt && \ | ||
| 9 | - pip install -U -r requirements/tools.txt && \ | ||
| 10 | - mypy --config-file pyproject.toml | ||
| 10 | + pip install -U -r requirements/async.txt | ||
| 11 | + pip install -U -r requirements/adapter.txt | ||
| 12 | + pip install -U -r requirements/tools.txt | ||
| 13 | + fi | ||
| 14 | + | ||
| 15 | + mypy --config-file pyproject.toml | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,12 +7,12 @@ script_dir=`dirname $0` | |||
| 7 | 7 | cd ${script_dir}/.. | |
| 8 | 8 | ||
| 9 | 9 | test_target="$1" | |
| 10 | - python_version=`python --version | awk '{print $2}'` | ||
| 10 | + | ||
| 11 | + ./scripts/format.sh --no-install | ||
| 11 | 12 | ||
| 12 | 13 | if [[ $test_target != "" ]] | |
| 13 | 14 | then | |
| 14 | - black slack_bolt/ tests/ && \ | ||
| 15 | - pytest -vv $1 | ||
| 15 | + pytest -vv $1 | ||
| 16 | 16 | else | |
| 17 | - black slack_bolt/ tests/ && pytest | ||
| 17 | + pytest | ||
| 18 | 18 | fi | |
| Back | FazBrowse Home | New Git URL |
0 commit comments