f51d6e4634
Build & Deploy / Build & Push Docker Image (push) Failing after 56s
Build & Deploy / Deploy to VPS (push) Has been skipped
Test / Type Check (all packages) (push) Failing after 40s
Test / API Unit Tests (push) Has been skipped
Test / Homepage Unit Tests (push) Has been skipped
Test / Storefront Unit Tests (push) Has been skipped
Test / Admin Unit Tests (push) Has been skipped
Test / Dashboard Unit Tests (push) Has been skipped
Test / API Integration Tests (push) Has been skipped
133 lines
3.3 KiB
YAML
133 lines
3.3 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: [develop]
|
|
pull_request:
|
|
branches: [develop]
|
|
|
|
concurrency:
|
|
group: test-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
NODE_VERSION: "20"
|
|
|
|
jobs:
|
|
type-check:
|
|
name: Type Check (all packages)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- run: npm ci
|
|
- run: npm run db:generate
|
|
- run: npm run type-check
|
|
|
|
api-tests:
|
|
name: API Unit Tests
|
|
runs-on: ubuntu-latest
|
|
needs: type-check
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- run: npm ci
|
|
- run: npm run db:generate
|
|
- run: npm run test:api
|
|
|
|
homepage-tests:
|
|
name: Homepage Unit Tests
|
|
runs-on: ubuntu-latest
|
|
needs: type-check
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- run: npm ci
|
|
- run: npm run build --workspace @rentaldrivego/types
|
|
- run: npm run test:homepage
|
|
|
|
storefront-tests:
|
|
name: Storefront Unit Tests
|
|
runs-on: ubuntu-latest
|
|
needs: type-check
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- run: npm ci
|
|
- run: npm run build --workspace @rentaldrivego/types
|
|
- run: npm run test:storefront
|
|
|
|
admin-tests:
|
|
name: Admin Unit Tests
|
|
runs-on: ubuntu-latest
|
|
needs: type-check
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- run: npm ci
|
|
- run: npm run test:admin
|
|
|
|
dashboard-tests:
|
|
name: Dashboard Unit Tests
|
|
runs-on: ubuntu-latest
|
|
needs: type-check
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- run: npm ci
|
|
- run: npm run build --workspace @rentaldrivego/types
|
|
- run: npm run test:dashboard
|
|
|
|
integration-tests:
|
|
name: API Integration Tests
|
|
runs-on: ubuntu-latest
|
|
needs: type-check
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
env:
|
|
POSTGRES_DB: rentaldrivego_test
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: password
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
redis:
|
|
image: redis:7-alpine
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
env:
|
|
DATABASE_URL: postgresql://postgres:password@postgres:5432/rentaldrivego_test
|
|
REDIS_URL: redis://redis:6379
|
|
NODE_ENV: test
|
|
JWT_SECRET: test-secret
|
|
JWT_EXPIRY: 8h
|
|
FILE_STORAGE_ROOT: /tmp/rentaldrivego-test-storage
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- run: npm ci
|
|
- run: npm run db:generate
|
|
- run: npm run db:deploy
|
|
- run: npx prisma db push --schema packages/database/prisma/schema.prisma
|
|
- run: npm run test:api:integration
|