From 685550bfdb2c9aa97643035bdbe4701d05bbee1d Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Sat, 7 Jun 2025 01:11:35 -0400 Subject: [PATCH] Add CI workflow for tests and dist verification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This workflow ensures: - All tests pass on PRs and main branch pushes - Test coverage is generated - The dist/ directory is up to date with source code 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 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..aa74e35 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Check test coverage + run: npm run coverage + + dist-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build dist + run: npm run build + + - name: Check if dist is up to date + run: | + if [ -n "$(git status --porcelain dist/)" ]; then + echo "::error::dist/ is not up to date. Please run 'npm run build' and commit the changes." + git diff dist/ + exit 1 + fi \ No newline at end of file