Merge pull request #92 from mbpictures/hotfix/minor-issues #339
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: ci | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-latest | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgres | |
# Provide the password for postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
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 | |
#strategy: | |
#matrix: | |
#node-version: [12.x, 14.x, 16.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
env: | |
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }} | |
NEXT_PUBLIC_NEXTAUTH_PATH: ${{ secrets.NEXT_PUBLIC_NEXTAUTH_PATH }} | |
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} | |
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/ticketshop-ci | |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY }} | |
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }} | |
STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }} | |
SOFORT_USERNAME: ${{ secrets.SOFORT_USERNAME }} | |
SOFORT_API_KEY: ${{ secrets.SOFORT_API_KEY }} | |
SOFORT_PROJECT_ID: ${{ secrets.SOFORT_PROJECT_ID }} | |
NEXT_PUBLIC_PAYPAL_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_PAYPAL_CLIENT_ID }} | |
PAYPAL_CLIENT_SECRET: ${{ secrets.PAYPAL_CLIENT_SECRET }} | |
PAYPAL_CLIENT_LIVE_ENVIRONMENT: ${{ secrets.PAYPAL_CLIENT_LIVE_ENVIRONMENT }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# Install NPM dependencies, cache them correctly | |
# and run all Cypress tests | |
- name: Use Node.js 14.18 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14.18' | |
cache: 'npm' | |
- name: Run E2E tests 🧪 | |
uses: cypress-io/github-action@v4 | |
with: | |
build: npm run cypress:build | |
start: npm run start:test | |
command: npm run cypress:run | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run Component tests 🧪 | |
uses: cypress-io/github-action@v4 | |
with: | |
install: false | |
command: npm run cypress:run-ct | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Coverage Report Upload | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage/lcov.info | |
name: tessera-cov | |
fail_ci_if_error: true # optional (default = false) |