Merge pull request #20 from Eldemarkki/dependabot/npm_and_yarn/rollup… #332
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run unit & integration tests | |
on: push | |
jobs: | |
recipeamigo-unit-tests: | |
runs-on: ubuntu-latest | |
container: node:18.16.0 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run unit tests | |
run: npm run test:unit:ci | |
recipeamigo-integration-tests: | |
runs-on: ubuntu-latest | |
container: node:18.16.0 | |
services: | |
postgres: | |
image: postgres:15 | |
env: | |
POSTGRES_USER: recipeamigo-test-user | |
POSTGRES_PASSWORD: recipeamigo-test-password | |
POSTGRES_DB: recipeamigo-test-database | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run migrations | |
run: npx prisma migrate deploy | |
env: | |
DATABASE_URL: postgresql://recipeamigo-test-user:recipeamigo-test-password@postgres:5432/recipeamigo-test-database | |
- name: Run integration tests | |
run: npm run test:integration:ci | |
env: | |
DATABASE_URL: postgresql://recipeamigo-test-user:recipeamigo-test-password@postgres:5432/recipeamigo-test-database |