Skip to content

Commit

Permalink
ci: Test testing with vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
Veikkosuhonen committed Jan 16, 2024
1 parent 7d08aa6 commit b5cc589
Show file tree
Hide file tree
Showing 6 changed files with 2,273 additions and 30 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,41 @@ on:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- uses: docker/setup-buildx-action@v2

- name: Build image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
build-args: |
E2E=true
push: false
load: true
tags: jami:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Start the application
run: docker-compose -f docker-compose.ci.yml up -d

- name: Install dependencies
run: npm ci

- name: Run tests
env:
CI: true
run: npm test

build-and-push:
runs-on: ubuntu-latest

Expand Down
29 changes: 29 additions & 0 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3.5'

services:
app:
build:
context: ./
dockerfile: Dockerfile
image: jami_dev
environment:
- DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- PORT=3003
volumes:
- ./:/usr/src/app
ports:
- 3000:3003
container_name: jami_dev
db:
image: postgres:13.1
environment:
- PGDATA=/data
- POSTGRES_PASSWORD=postgres
ports:
- 5432:5432
volumes:
- pg_data:/data
container_name: jami_db

volumes:
pg_data:
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
image: jami_dev
environment:
- DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- PORT=3000
volumes:
- ./:/usr/src/app
ports:
Expand Down
Loading

0 comments on commit b5cc589

Please sign in to comment.