From c7238313b373e4d0cdff556180ab4131f026a8a1 Mon Sep 17 00:00:00 2001 From: Kagura Chen Date: Wed, 18 Mar 2026 15:58:54 +0800 Subject: [PATCH] ci: add GitHub Actions workflow for automated testing - Run tests on push to main and on pull requests - Test against Node.js 18 and 20 - Use npm ci for reproducible installs - Provide test environment variables (non-sensitive placeholders) Re-submission of PR #2 (which was approved but closed). --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3c2d486 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18, 20] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: npm + + - run: npm ci + + - name: Run tests + run: npm test + env: + NODE_ENV: test + JWT_SECRET: ci-test-jwt-secret-not-real + SESSION_SECRET: ci-test-session-secret-not-real + ADMIN_USERNAME: ci-test-admin + ADMIN_PASSWORD: ci-test-password + ALLOWED_ORIGINS: http://localhost:3000