Skip to content

ci: split cloud/VM workflows into provider-specific files - #325

Merged
loadinglucian merged 4 commits into
mainfrom
ci/add-path-filters-to-workflows
Feb 10, 2026
Merged

ci: split cloud/VM workflows into provider-specific files#325
loadinglucian merged 4 commits into
mainfrom
ci/add-path-filters-to-workflows

Conversation

@loadinglucian

@loadinglucian loadinglucian commented Feb 10, 2026

Copy link
Copy Markdown
Owner

Summary

Split monolithic bats-cloud.yml and bats-vm.yml workflows into separate provider/distro-specific files with path filters to reduce unnecessary CI runs.

New workflows:

  • bats-cloud-aws.yml - AWS cloud tests only
  • bats-cloud-do.yml - DigitalOcean cloud tests only
  • bats-vm-ubuntu24.yml - Ubuntu 24.04 VM tests only

Path filtering:

  • AWS workflow excludes DO-specific code paths
  • DO workflow excludes AWS and CF-specific code paths
  • VM workflow excludes all cloud provider code

Other changes:

  • Janitor workflow now references split workflows in workflow_run trigger
  • Janitor loads credentials from .env file for consistency with test workflows
  • Janitor discovers active workflows dynamically via find .github/workflows/bats-cloud-*.yml

Benefits

  • Reduced CI runtime: only relevant provider tests run when code changes
  • Better isolation: provider-specific changes don't trigger unrelated tests
  • Easier debugging: separate workflow runs per provider

Skip CI runs when changes only affect files outside the core code,
playbooks, tests, and dependency paths. Both workflows now watch
the same set of paths for pull_request and push triggers.
@coderabbitai

coderabbitai Bot commented Feb 10, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Splits combined BATS CI workflows into provider-specific cloud workflows and a distro-specific VM workflow, updates the janitor workflow to source a local .env and trigger on the new workflows, and changes the janitor script to iterate over all bats-cloud-*.yml workflows when loading protected suffixes.

Changes

Cohort / File(s) Summary
Removed workflows
.github/workflows/bats-cloud.yml, .github/workflows/bats-vm.yml
Deleted the monolithic cloud and VM workflow definitions and their jobs/triggers.
Added cloud workflows (per-provider)
.github/workflows/bats-cloud-aws.yml, .github/workflows/bats-cloud-do.yml
New provider-specific cloud test workflows (AWS, DO) with selective path filters, concurrency/timeouts, PHP/Composer and BATS setup, SSH key handling, .env creation from secrets, provider-targeted ./bats.sh ci cloud <provider> runs, and always-run cleanup invoking the janitor script.
Added VM workflow (Ubuntu)
.github/workflows/bats-vm-ubuntu24.yml
New VM test workflow for ubuntu-24.04 with path filters, reusable PHP/Composer setup, Lima setup, fixture and SSH key generation, .env from secret, and ./bats.sh ci vm ubuntu24 execution.
Modified janitor workflow
.github/workflows/bats-cloud-janitor.yml
Updated workflow_run triggers to the new provider workflows; removed direct secret env declarations from job env; jobs now source a local .env (set -a/set +a) before running janitor scripts in workflow_run/schedule/dispatch contexts.
Updated janitor script
tests/bats/lib/cloud-janitor.sh
load_protected_suffixes now loops over .github/workflows/bats-cloud-*.yml (excluding the janitor file) and queries workflow runs per file via the GitHub API, preserving min_age filtering and adding protected suffixes per run.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: splitting monolithic workflows into provider-specific files with path filters, which aligns perfectly with the primary objective of the PR.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, covering new workflows, path filtering strategies, and benefits—all matching the actual file modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.github/workflows/bats-vm.yml:
- Around line 24-36: The push workflow's path triggers in
.github/workflows/bats-vm.yml incorrectly include cloud workflow files; edit the
push.paths array (the paths list under the push trigger) and remove the entries
".github/workflows/bats-cloud.yml" and
".github/workflows/bats-cloud-janitor.yml" so those cloud workflows are not
triggered by pushes in this VM workflow, leaving the other path entries
untouched.
- Around line 8-20: The workflow path filters include cloud-specific entries
".github/workflows/bats-cloud.yml" and
".github/workflows/bats-cloud-janitor.yml" which should not trigger the VM
workflow; remove those two entries from the paths: list in the bats-vm workflow
(i.e., delete the lines containing ".github/workflows/bats-cloud.yml" and
".github/workflows/bats-cloud-janitor.yml") so the VM tests only run for
relevant files like "app/**", "tests/bats/**", "bats.sh", etc.

Comment thread .github/workflows/bats-vm.yml Outdated
Comment thread .github/workflows/bats-vm.yml Outdated
Split monolithic `bats-cloud.yml` and `bats-vm.yml` workflows into
separate provider/distro-specific files with path filters to reduce
unnecessary CI runs:

- `bats-cloud-aws.yml` - AWS cloud tests only
- `bats-cloud-do.yml` - DigitalOcean cloud tests only
- `bats-vm-ubuntu24.yml` - Ubuntu 24.04 VM tests only

Path filters exclude irrelevant provider code paths:
- AWS workflow excludes DO-specific files
- DO workflow excludes AWS and CF-specific files
- VM workflow excludes all cloud provider files

Updated janitor workflow to reference split cloud workflows and load
credentials from .env file instead of job-level env vars for
consistency with test workflows.

Cloud janitor now discovers active workflows dynamically by globbing
`bats-cloud-*.yml` files instead of hardcoding workflow name.
@loadinglucian loadinglucian changed the title ci: add path filters to VM and cloud test workflows ci: split cloud/VM workflows into provider-specific files Feb 10, 2026
Lucian Behind The Scenes added 2 commits February 10, 2026 16:01
Simplify cloud test SSH key setup by directly using GitHub Secrets instead of attempting to source from .env files with fallback logic. This makes the configuration more explicit and aligns with GitHub Actions best practices.
@loadinglucian
loadinglucian merged commit 2efdc30 into main Feb 10, 2026
10 checks passed
@loadinglucian
loadinglucian deleted the ci/add-path-filters-to-workflows branch February 10, 2026 14:31
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