Testing steps to avoid wrong implementation
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
name: Run Tests on Branches
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
test-backend:
|
||||
name: Backend Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: backend/package-lock.json
|
||||
|
||||
- name: Install Backend Dependencies
|
||||
run: cd backend && npm ci
|
||||
|
||||
- name: Run Backend Tests
|
||||
run: cd backend && npm test -- --ci
|
||||
|
||||
test-frontend:
|
||||
name: Frontend Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: frontend/package-lock.json
|
||||
|
||||
- name: Install Frontend Dependencies
|
||||
run: cd frontend && npm ci
|
||||
|
||||
- name: Run Frontend Tests
|
||||
run: cd frontend && npm test -- --run --reporter=basic
|
||||
Reference in New Issue
Block a user