Skip to content

fix: improve pagination buttons on mobile and fix cancel error #112

fix: improve pagination buttons on mobile and fix cancel error

fix: improve pagination buttons on mobile and fix cancel error #112

Workflow file for this run

# Continuous Integration Pipeline
# Runs on every push and pull request
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
env:
NODE_VERSION: '20'
jobs:
# Lint job
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
- name: Check formatting
run: npm run format:check
# Backend tests
test-backend:
name: Test Backend
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:7
env:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password
ports:
- 27017:27017
options: >-
--health-cmd "mongosh --eval 'db.adminCommand({ping: 1})'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run backend tests
run: npm run test:backend -- --coverage
env:
NODE_ENV: test
MONGODB_URI: mongodb://admin:password@localhost:27017/mwm_test?authSource=admin
REDIS_URL: redis://localhost:6379
JWT_SECRET: test-jwt-secret-key-that-is-at-least-32-chars-long
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ./backend/coverage/lcov.info
flags: backend
fail_ci_if_error: false
# Frontend tests
test-frontend:
name: Test Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run frontend tests
run: npm run test:frontend -- --coverage
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ./frontend/coverage/lcov.info
flags: frontend
fail_ci_if_error: false
# Build job
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, test-backend, test-frontend]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build shared packages
run: npm run build --workspace=@mwm/shared
- name: Build backend
run: npm run build:backend
- name: Build frontend
run: npm run build:frontend
env:
NEXT_PUBLIC_API_URL: https://api.example.com
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: |
backend/dist
frontend/.next
retention-days: 7
# Docker build test
docker:
name: Docker Build
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build backend image
uses: docker/build-push-action@v5
with:
context: .
file: ./backend/Dockerfile.prod
push: false
tags: mwm-backend:test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build frontend image
uses: docker/build-push-action@v5
with:
context: .
file: ./frontend/Dockerfile.prod
push: false
tags: mwm-frontend:test
cache-from: type=gha
cache-to: type=gha,mode=max