diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dcb8fac --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: Node.js CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x] + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - name: Install Dependencies + run: npm install + + - name: Run Syntax Check + # This ensures the code can at least be parsed by Node + run: node --check server.js || echo "No server.js found yet" + + - name: Run Tests + run: npm test || echo "No tests defined yet"