💚 Arreglar error prisma client #37
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: testing-workflow | |
on: | |
push: | |
# paths: | |
# - 'src/**/*.ts' | |
# - 'cypress/**/*.ts' | |
jobs: | |
init-cache: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'pnpm' | |
cache-dependency-path: ./pnpm-lock.yaml | |
- run: pnpm install && prisma generate | |
- run: pnpm run build | |
- name: Build Caching | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
${{ github.workspace }}/.next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- | |
unit-tests: | |
needs: init-cache | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:node-20.18.0-chrome-129.0.6668.89-1-ff-131.0.2-edge-129.0.2792.65-1 | |
options: --user 1001 | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'pnpm' | |
cache-dependency-path: ./pnpm-lock.yaml | |
- name: "Unit tests" | |
uses: cypress-io/github-action@v6 | |
with: | |
browser: chrome | |
spec: cypress/unit/* | |
config-file: cypress.config.ts | |
env: | |
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/proyecto-tfg | |
ui-chrome-desktop-tests: | |
needs: init-cache | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:node-20.18.0-chrome-129.0.6668.89-1-ff-131.0.2-edge-129.0.2792.65-1 | |
options: --user 1001 | |
strategy: | |
fail-fast: false | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'pnpm' | |
cache-dependency-path: ./pnpm-lock.yaml | |
- name: "UI Desktop Tests - Chrome" | |
uses: cypress-io/github-action@v6 | |
with: | |
build: pnpm run build && pnpm run ci:prisma | |
start: pnpm run start | |
wait-on: "http://localhost:3000" | |
wait-on-timeout: 120 | |
browser: chrome | |
spec: cypress/e2e/* | |
config-file: cypress.config.ts | |
env: | |
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/proyecto-tfg | |
ui-chrome-mobile-tests: | |
needs: init-cache | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:node-20.18.0-chrome-129.0.6668.89-1-ff-131.0.2-edge-129.0.2792.65-1 | |
options: --user 1001 | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'pnpm' | |
cache-dependency-path: ./pnpm-lock.yaml | |
- name: "UI Tests - Chrome - Mobile" | |
uses: cypress-io/github-action@v6 | |
with: | |
config: '{"e2e":{"viewportWidth":375,"viewportHeight":667}}' | |
build: pnpm run build && pnpm run ci:prisma | |
start: pnpm run start | |
wait-on: "http://localhost:3000" | |
wait-on-timeout: 120 | |
browser: chrome | |
record: true | |
parallel: true | |
spec: cypress/e2e/* | |
config-file: cypress.config.ts |