From 98eeffc461948ddbc62f16399aaf7693e67c2185 Mon Sep 17 00:00:00 2001 From: gardenGnostic Date: Thu, 5 Mar 2026 00:41:50 +0100 Subject: [PATCH] Add CI workflow for linting and smoke testing --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 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..dfc9892 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: ["main", "dev"] + pull_request: + branches: ["main"] + +jobs: + lint-and-build: + name: Lint & Smoke Test + runs-on: ubuntu-latest + + steps: + - name: Checkout + 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: Check for syntax errors + run: node --check main.js + + - name: Verify package.json scripts exist + run: | + node -e " + const pkg = require('./package.json'); + const required = ['start', 'dist']; + for (const s of required) { + if (!pkg.scripts?.[s]) { + console.error('Missing script:', s); + process.exit(1); + } + } + console.log('All required scripts present.'); + "