Skip to content

run 16 and 18

run 16 and 18 #3

Workflow file for this run

name: CI Workflow
on:
push:
branches:
- week5
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
backend-tests:
name: Backend Tests (Node.js ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16,18]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: week5/backend/package-lock.json
- name: Install backend dependencies
run: |
cd week5/backend
npm ci
- name: Run backend tests
run: |
cd week5/backend
npm test
- name: Start backend server and health check
run: |
cd week5/backend
npm start &
sleep 5
curl -f http://localhost:3000/health
curl -f http://localhost:3000/api/users
pkill -f "node server.js"
frontend-tests:
name: Frontend Tests (Node.js ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: week5/frontend/package-lock.json
- name: Install frontend dependencies
run: |
cd week5/frontend
npm ci
- name: Run frontend tests
run: |
cd week5/frontend
npm test