Skip to content

ci: add self-hosted CI workflow and raise test coverage - #2

Merged
luthermonson merged 2 commits into
mainfrom
feat/ci-and-coverage
Aug 17, 2026
Merged

ci: add self-hosted CI workflow and raise test coverage#2
luthermonson merged 2 commits into
mainfrom
feat/ci-and-coverage

Conversation

@luthermonson

Copy link
Copy Markdown
Contributor

Summary

Adds full CI for switchboard on the ephpm org's ephemerd self-hosted fleet, and raises unit-test coverage from 48 to 79 tests.

CI (.github/workflows/ci.yml)

Runs on [self-hosted, linux, x64] (same label ephpm/ephpm uses, so the fleet picks it up). Triggers: push to main, PRs to [main, "feat/**"]. Jobs:

  • fmtcargo fmt --all -- --check on stable (no rustfmt.toml, so no nightly-only options; nightly is unnecessary here).
  • clippycargo clippy --all-targets -- -D warnings.
  • testcargo test.
  • msrvcargo check --all-targets pinned to the declared rust-version = 1.85.

Pure Rust: no PHP, no SDK, no Docker.

Coverage (+31 tests)

Real behavior assertions over pure/testable logic only (no live-network or running-server tests):

  • config.rs (new module): clap defaults, explicit-flag overrides, missing-required-arg and non-numeric app_id rejection.
  • main.rs (new module): base64_url_encode — padding-free, URL-safe alphabet (-/_, never +//), decode round-trip.
  • github.rs: extracted the teardown comment body into a pure teardown_comment_body() fn so it's testable; added marker/table-structure, one-decimal duration rounding, and all-framework label coverage.
  • deployer.rs: dotenv quoting/escaping, preview_url non-8.x and arbitrary-8.x-minor edges, Symfony/Drupal detection + WordPress precedence, teardown removes the dir / is-ok-when-absent.
  • manifest.rs: Symfony/Drupal framework defaults, database: none / case-insensitive turso, explicit websocket, legacy-json default preservation.
  • secrets.rs: multiple refs in one string, repo→default fallback, empty env-suffix skip.

Local (WSL, shared warm target): fmt clean, clippy clean, 79/79 tests pass, MSRV 1.85 check passes.

Add .github/workflows/ci.yml targeting the ephpm orgs
…inker)

The ephemerd runner image ships without a C compiler. Even though
switchboard is pure Rust, unavoidable transitive deps have build scripts
(proc-macro2, libc) or compile C (ring, via reqwest's rustls stack), so
every compile job died at "linker cc not found" before checking any of
our code. fmt was unaffected (it never compiles). Add the same
root/sudo-aware build-essential install step ephpm/ephpm uses to the
clippy, test, and msrv jobs.
@luthermonson
luthermonson merged commit ca203ff into main Aug 17, 2026
4 checks passed
@luthermonson
luthermonson deleted the feat/ci-and-coverage branch August 17, 2026 19:45
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