ci: add GitHub Actions CI with ShellCheck, bats unit tests, and a host-prep matrix#48
Merged
Merged
Conversation
Cover the pure-ish logic in `functions` with external commands stubbed on PATH so nothing touches the host: parse_args flag handling, ee_apt_update lock-retry behaviour, ondrej PPA status probing, the host-PHP selection algorithm (native vs third-party, version-first ordering), and the phar checksum-verification path (match/mismatch/empty/download-failure).
Run the installer's host-preparation stage against a distro's real apt repos inside a container, bounded before the phar download / image pull (docker stubbed). Validates PHP selection and the required PHP extensions across Ubuntu and Debian releases — the OS-version-dependent surface that stubs cannot reproduce. Includes run-matrix.sh for running the matrix locally.
GitHub Actions runs ShellCheck (gating setup.sh and functions at error severity; migration scripts informational), the bats unit suite, and the host-prep integration matrix across Ubuntu 22.04/24.04/rolling/devel and Debian 12/13. .shellcheckrc disables the unfollowable-source warnings for the runtime-sourced helper files. tests/README.md documents the layout, how to run, the phar-boundary rationale, and the known issues surfaced.
`ubuntu:rolling` resolves to 26.04 today but floats forward to the next stable release. Pin 26.04 explicitly so the release that drove the host-PHP fixes keeps a dedicated matrix leg once `rolling` moves on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
The installer had no automated testing. This adds a first test layer plus CI, with no changes to the installer's production code (
setup.sh/functionsare untouched — purely additive).CI —
.github/workflows/ci.yml+.shellcheckrcsetup.sh+functionsat error severity (both are error-clean today); reports the migration scripts informationally until their findings are triaged.22.04 / 24.04 / 26.04 / rolling / develand Debian12 / 13.Unit tests —
tests/unit/*.bats(31 tests)External commands (
apt-get,curl,sleep, …) are stubbed onPATH, so nothing touches the host:parse_argsflag handlingee_apt_update— retries only on apt/dpkg lock contention, aborts on any other errorget_ondrej_php_ppa_release_status— 200 / 404 / curl failureee_select_and_install_php— native vs third-party PPA, version-first ordering, no-candidatedownload_and_install_easyengine— checksum match / mismatch / empty phar / empty checksum / download failureIntegration —
tests/integration/host-prep.sh(+run-matrix.sh)Runs the host-prep stage against a distro's real apt repos in a container, bounded before the phar download / image pull (docker stubbed). That step (
ee cli info→ global service image pulls) is EasyEngine-core behaviour, needs a Docker daemon, and is slow/flaky in CI — so it's out of scope here. What remains is the OS-version-dependent surface that has actually regressed before (PHP selection across releases + the required PHP extensions), which can only be validated against real distro repos and the real ondrej/sury PPAs.Verification
bats/batscontainer)..shellcheckrcsuppresses the unfollowable-source warnings for the runtime-sourced helpers.Known issues surfaced (documented in
tests/README.md, not fixed here)--dry-runis documented and parsed (EE_DRY_RUN) but read nowhere →ee migrate --dry-runperforms a real migration.--tracesetsEE_TRACE, but the migration scripts check$TRACE→ no-op.--all(EE_SITE_ALL) is also unused.migration/migrate.sh:156references$new_site_name, which is never assigned.migration/{migrate,remote-migrate}reference undefined$migrate/$Red/$RCol, plus 8 error-levelSC2068unquoted array expansions.Possible follow-ups
EE_LOCAL_PHARseam (mirroring the existingEE_LOCAL_FUNCTIONShook) to enable a fullsetup.shend-to-end + idempotency test, and to support air-gapped/mirror installs.add_ssl_renew_croncoverage (incl. the no-existing-crontab case).debian:testing(Forky/14) as the Debian analog ofubuntu:develfor next-release early warning.