Skip to content

ci: consolidate and harden CI workflows#451

Draft
peacker wants to merge 1 commit intodevelopfrom
feature/ci-improvements
Draft

ci: consolidate and harden CI workflows#451
peacker wants to merge 1 commit intodevelopfrom
feature/ci-improvements

Conversation

@peacker
Copy link
Copy Markdown
Collaborator

@peacker peacker commented May 2, 2026

Why

This PR reduces CI duplication, improves maintainability, and modernizes a few workflow actions while preserving the split between doctests (documentation/user-facing examples) and pytest (correctness + coverage).

What changed

Added a reusable composite action for the repeated workspace fix step.
Consolidated doctest execution into the main test workflow so doctests and pytest run in the same PR pipeline.
Removed the now-redundant standalone doctest workflow.
Restricted broad push triggers so full test jobs do not run on every branch push.
Added fork-safe guard for SonarCloud coverage job to avoid artifact-related failures.
Extended fork CI to run doctests too (with reduced parallelism suitable for GitHub-hosted runners).
Updated benchmark workflow to use the shared workspace-fix action and modern checkout.
Standardized Docker layer caching to GHA cache in webapp image workflows.
Updated deprecated release creation step to use gh release create.
Removed force-push behavior from documentation workflow.
Upgraded outdated workflow actions (checkout, setup-python) to the current major versions.

Expected impact

Fewer duplicated CI steps and less maintenance overhead.
More predictable PR behavior for both internal branches and forks.
Lower risk of CI breakage from deprecated actions.
Safer workflow behavior around branch protections and documentation updates.

- Extract repeated 'Fix Directory Structure' bash into a composite
  action (.github/actions/fix-directory/action.yml) and reference it
  from run-pytest-and-sonarcloud-scan, run-benchmark-tests.

- Merge run-doctest.yaml into run-pytest-and-sonarcloud-scan.yaml as a
  parallel job (doctests serve a different purpose from pytest but share
  the same trigger events). Delete the now-redundant standalone file.

- Restrict pytest/doctest push trigger from '**' to develop+main to
  avoid running the full suite on every feature-branch push.

- Add missing if-not-fork guard to run-code-coverage (SonarCloud) job
  so it no longer tries to download a non-existent artifact on fork PRs.

- Add doctest job to fork-run-pytest.yaml (reduced parallelism -tp 4
  to fit GitHub-hosted 7 GB / 2 vCPU limit); bump checkout to v4.

- Replace local-file Docker layer cache (/tmp/.buildx-cache) in
  build-staging-webapp-image and build-main-webapp-image with
  type=gha (same scope as build-claasp-base-image) so that the second
  build on develop/main gets full cache hits instead of a cold rebuild.
  Also removes the destructive 'docker system prune -a --volumes -f'
  call from the staging workflow.

- Replace deprecated actions/create-release@v1 in update-changelog.yaml
  with the gh CLI equivalent to avoid future breakage.

- Remove 'force: true' from the documentation commit push to main
  (bypassed branch protection rules).

- Bump all actions/checkout@v2 and @V3 occurrences to @v4.
  Bump actions/setup-python@v2 to @v5 in update-changelog.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant