-
-
Notifications
You must be signed in to change notification settings - Fork 3
85 lines (80 loc) · 3.01 KB
/
node.js.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# 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)