Add CI workflow for linting and smoke testing

This commit is contained in:
gardenGnostic 2026-03-05 00:41:50 +01:00 committed by GitHub
parent aff0d329ba
commit 98eeffc461
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

42
.github/workflows/ci.yml vendored Normal file
View file

@ -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.');
"