Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Sawaka CI

on:
push:
branches: [ main, qa ]
pull_request:
branches: [ main, qa ]

jobs:
ci:
runs-on: ubuntu-latest

env:
NODE_ENV: test
MONGO_URI: ${{ secrets.MONGO_URI_TEST }}
FRONTEND_URL: http://localhost:3000

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

# ================= BACKEND =================
- name: Install backend dependencies
working-directory: backend-api
run: npm install

- name: Run backend tests (Jest)
working-directory: backend-api
run: npm test

# ================= API (Newman) =================
- name: Install Newman
run: npm install -g newman

- name: Start backend API
working-directory: backend-api
run: |
npm start &
sleep 10

- name: Run API tests (Newman)
run: |
newman run tests/api/postman/sawaka.postman_collection.json \
-e tests/api/postman/sawaka.postman_environment.json

# ================= FRONTEND =================
- name: Install frontend dependencies
run: npm install

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Run Playwright tests
run: npx playwright test
Loading