Skip to content

ci: add GitHub Actions workflow for lint and test - #34

Merged
Alex1990 merged 4 commits into
mainfrom
loop/33-ci-workflow
Sep 9, 2026
Merged

Alex1990 merged 4 commits into
mainfrom
loop/33-ci-workflow

Conversation

@Alex1990

@Alex1990 Alex1990 commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Closes #33
loop-task: #33

Requirement

Trigger lint and tests on new commits to main and on pull requests.

Changes

  • Add .github/workflows/ci.yml with two jobs:
    • Lint: pnpm lint (oxlint src test), node 22 + pnpm 11 with cached installs.
    • Test: pnpm test:ci (vitest run --browser.headless, Playwright chromium installed with system deps). The Hono test server (pnpm serve, :8080) is started first so the four integration suites fetch their config endpoint and skip cleanly when no credentials are present (CI has none); startup is polled and the log is dumped if it fails.
  • Concurrency group cancels superseded runs on the same ref.

Verification

  • Workflow YAML parses (yaml pkg).
  • Local smoke: pnpm lint exits 0; signature/unit specs pass headless in Chromium (52 tests, 5 files).
  • This PR itself is the end-to-end check: the workflow runs on pull_request and is exercised by this change.

Run oxlint and the Playwright-backed vitest suite on every push to
main and on pull requests. The Hono test server is started first so
credential-less integration specs keep skipping instead of failing.

Closes #33
Align test/index.spec.ts with the other integration suites (cos/obs/aws/azure),
which already skip when credentials are absent: probe /api/oss-config in a
beforeAll and let every real-OSS case bail early. This keeps a credential-less
CI run green while preserving full local integration coverage.
@Alex1990

Alex1990 commented Sep 9, 2026

Copy link
Copy Markdown
Owner Author

First CI run exposed a gap: test/index.spec.ts (OSS integration, main entry) was the only integration suite without the credential guard — the other four (cos/obs/aws/azure) skip cleanly when credentials are absent, this one failed with require accessKeyId, accessKeySecret. Fixed by probing /api/oss-config in a beforeAll and skipping the 12 real-OSS cases when unconfigured. Re-run: Lint pass, Test pass (231 passed, 26 skipped).

@Alex1990

Alex1990 commented Sep 9, 2026

Copy link
Copy Markdown
Owner Author

Add coverage and show with comment in pr

Test job now runs pnpm test:ci:coverage (json-summary reporter added to
vitest.config.ts). A small script (coverage-comment.mjs) renders the totals
and upserts a single marked comment on the PR, so re-runs update instead of
stacking.
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Coverage

Metric % Covered / Total
Lines 90.19% 1003/1112
Statements 89.06% 1083/1216
Functions 91.03% 193/212
Branches 76.43% 519/679

@Alex1990
Alex1990 merged commit 8020b24 into main Sep 9, 2026
2 checks passed
@Alex1990
Alex1990 deleted the loop/33-ci-workflow branch September 9, 2026 12:14
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.

Add github action workflow to run lint and test

1 participant