From 2971e112a9e4b6e7b27bc2aaaecd8fda5948894a Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 6 Feb 2026 15:11:24 -0500 Subject: [PATCH 1/2] ci: consolidate CI workflows into single ci-build.yml Consolidates separate workflow files (flake8.yml, mypy.yml, tests.yml, codecov.yml) into a single ci-build.yml following the bolt-python pattern. This provides better CI overview, easier maintenance, and consistent job dependencies. The new workflow includes: - lint job (flake8 via scripts/lint.sh) - typecheck job (mypy via scripts/run_mypy.sh) - unittest job (pytest across Python 3.9-3.14 + pypy3.10) - codecov job (coverage reporting) - health-score job (health metrics) - notifications job (regression failure alerts) Co-Authored-By: Claude --- .github/workflows/ci-build.yml | 161 +++++++++++++++++++++++++++++++++ .github/workflows/codecov.yml | 55 ----------- .github/workflows/flake8.yml | 25 ----- .github/workflows/mypy.yml | 25 ----- .github/workflows/tests.yml | 40 -------- 5 files changed, 161 insertions(+), 145 deletions(-) create mode 100644 .github/workflows/ci-build.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/flake8.yml delete mode 100644 .github/workflows/mypy.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..d4749a7 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,161 @@ +name: Python CI + +on: + push: + branches: + - main + pull_request: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +env: + LATEST_SUPPORTED_PY: "3.14" + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: ${{ env.LATEST_SUPPORTED_PY }} + - name: Run flake8 verification + run: ./scripts/lint.sh + + typecheck: + name: Typecheck + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: ${{ env.LATEST_SUPPORTED_PY }} + - name: Run mypy verification + run: ./scripts/run_mypy.sh + + unittest: + name: Unit tests + runs-on: ubuntu-24.04 + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + python-version: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" + - "pypy3.10" + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install -U pip + pip install -r requirements.txt + pip install -r requirements/testing.txt + - name: Run tests + run: | + pytest --junitxml=reports/test.xml + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 + with: + directory: ./reports/ + fail_ci_if_error: true + flags: ${{ matrix.python-version }} + report_type: test_results + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + + codecov: + name: Code Coverage + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: ${{ env.LATEST_SUPPORTED_PY }} + - name: Install dependencies + run: | + pip install -U pip + pip install -r requirements.txt + pip install -r requirements/testing.txt + - name: Run all tests for codecov + run: | + pytest --cov=./slack_cli_hooks/ --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 + + health-score: + name: Health Score + needs: codecov + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + checks: write + steps: + - name: Setup repo + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Report health score + uses: slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1 + with: + codecov_token: ${{ secrets.FILS_CODECOV_API_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + extension: py + include: slack_cli_hooks + + notifications: + name: Regression notifications + runs-on: ubuntu-latest + needs: + - lint + - 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/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 9890142..0000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Run codecov - -on: - push: - branches: - - main - pull_request: - -jobs: - run: - runs-on: ubuntu-latest - timeout-minutes: 5 - permissions: - contents: read - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: 3.14 - - name: Install dependencies - run: | - pip install -U pip - pip install -r requirements.txt - pip install -r requirements/testing.txt - - name: Run all tests for codecov - run: | - pytest --cov=./slack_cli_hooks/ --cov-report=xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - verbose: true - - health-score: - needs: run - permissions: - checks: write - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - name: Setup repo - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Report health score - uses: slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1 - with: - codecov_token: ${{ secrets.FILS_CODECOV_API_TOKEN }} - github_token: ${{ secrets.GITHUB_TOKEN }} - extension: py - include: slack_cli_hooks diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml deleted file mode 100644 index 1adc450..0000000 --- a/.github/workflows/flake8.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Run flake8 validation - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 2 - permissions: - contents: read - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: 3.14 - - name: Run flake8 verification - run: | - ./scripts/lint.sh diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml deleted file mode 100644 index 7b0dc08..0000000 --- a/.github/workflows/mypy.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Run mypy validation - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 2 - permissions: - contents: read - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: 3.14 - - name: Run mypy verification - run: | - ./scripts/run_mypy.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 903636c..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Run all the unit tests - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-24.04 - timeout-minutes: 5 - strategy: - matrix: - python-version: - - "3.9" - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - - "pypy3.10" - permissions: - contents: read - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install -U pip - pip install -r requirements.txt - pip install -r requirements/testing.txt - - name: Run tests - run: | - pytest From 6392804f2762b8f8e1c21859aad1ed22f6a2f30d Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 6 Feb 2026 15:12:43 -0500 Subject: [PATCH 2/2] ci: remove notifications job from ci-build workflow The notifications job is not needed for this project. Co-Authored-By: Claude --- .github/workflows/ci-build.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index d4749a7..499544e 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -140,22 +140,3 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} extension: py include: slack_cli_hooks - - notifications: - name: Regression notifications - runs-on: ubuntu-latest - needs: - - lint - - 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 }}"