Merge pull request #72 from ItaloRAmaral/69-core-definir-schema-do-pr… #52
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: Unit Tests Pipeline | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
env: | |
HUSKY: 0 | |
jobs: | |
tests-pipeline: | |
runs-on: ubuntu-latest | |
env: | |
JWT_PRIVATE_KEY: ${{ secrets.JWT_PRIVATE_KEY }} | |
JWT_PUBLIC_KEY: ${{ secrets.JWT_PUBLIC_KEY }} | |
POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | |
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | |
POSTGRES_DB: ${{ secrets.POSTGRES_DB }} | |
POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }} | |
POSTGRES_SCHEMA: ${{ secrets.POSTGRES_SCHEMA }} | |
API_KEY: ${{ secrets.API_KEY }} | |
defaults: | |
run: | |
working-directory: ${{ github.workspace }} | |
steps: | |
- name: 'Checkout Repository' | |
uses: actions/checkout@v4 | |
- name: Install PNPM | |
uses: pnpm/[email protected] | |
with: | |
version: '8' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Set up environment variables | |
run: | | |
echo "DATABASE_URL=postgresql://${{ secrets.POSTGRES_USER }}:${{ secrets.POSTGRES_PASSWORD }}@localhost:5432/${{ secrets.POSTGRES_DB }}?schema=${{ secrets.POSTGRES_SCHEMA }}" >> $GITHUB_ENV | |
- name: Setting up docker compose | |
run: docker compose up -d | |
- name: Setting up prisma postgresql database | |
run: | | |
pnpm run prisma:core:schema:generate | |
pnpm run prisma:core:schema:migrate | |
- name: Run E2E Tests | |
run: pnpm run test:e2e | |
- name: Run Unit Tests | |
run: pnpm run test:unit |