Skip to content

Merge pull request #8 from iswilljr/dependabot/npm_and_yarn/babel/tra… #34

Merge pull request #8 from iswilljr/dependabot/npm_and_yarn/babel/tra…

Merge pull request #8 from iswilljr/dependabot/npm_and_yarn/babel/tra… #34

Workflow file for this run

name: Rick and Morty API Unit and E2E Testing
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
container: node:18
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:14.3
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: rickandmortyapi
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: pnpm install
- name: Unit Testing
run: pnpm run test
env:
BASE_URL: http://localhost:4000
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DB: rickandmortyapi
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
- name: E2E Testing
run: pnpm run test:e2e
env:
BASE_URL: http://localhost:4000
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DB: rickandmortyapi
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres