-
Notifications
You must be signed in to change notification settings - Fork 3
118 lines (95 loc) · 3.08 KB
/
CI.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: CI
on:
pull_request:
branches:
- dev
push:
branches:
- dev
concurrency: ci-${{ github.ref }}
jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Lint and Format
run: npm run lint:ci
- name: Build
run: npm run build
- name: Test
run: npm run test:unit
chromatic:
runs-on: ubuntu-latest
timeout-minutes: 10
environment: Chromatic
env:
APP_API_ENDPOINT: /graphql
NODE_ENV: development
APP_FILE_STORAGE_API_ENDPOINT: ${{vars.APP_FILE_STORAGE_API_ENDPOINT }}
APP_GRAPHQL_SCHEMA_URL: ${{ vars.APP_GRAPHQL_SCHEMA_URL }}
APP_AUTH0_AUDIENCE: ${{ vars.APP_AUTH0_AUDIENCE }}
APP_AUTH0_DOMAIN: ${{ vars.APP_AUTH0_DOMAIN }}
APP_AUTH0_CLIENT_ID: ${{ secrets.APP_AUTH0_CLIENT_ID }}
APP_HASURA_ADMIN_SECRET: ${{ secrets.APP_HASURA_ADMIN_SECRET }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# NOTE: required because https://www.chromatic.com/docs/github-actions#support-for-codeactionscheckoutv2code-and-above
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Deploy Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true # NOTE: Option to prevent the workflow from failing
cypress-run:
runs-on: ubuntu-latest
timeout-minutes: 20
environment: Preview
env:
APP_FILE_STORAGE_API_ENDPOINT: ${{vars.APP_FILE_STORAGE_API_ENDPOINT }}
APP_GRAPHQL_SCHEMA_URL: ${{ vars.APP_GRAPHQL_SCHEMA_URL }}
APP_AUTH0_AUDIENCE: ${{ vars.APP_AUTH0_AUDIENCE }}
APP_API_ENDPOINT: ${{ vars.APP_API_ENDPOINT }}
APP_AUTH0_DOMAIN: ${{ vars.APP_AUTH0_DOMAIN }}
APP_AUTH0_CLIENT_ID: ${{ secrets.APP_AUTH0_CLIENT_ID }}
APP_HASURA_ADMIN_SECRET: ${{ secrets.APP_HASURA_ADMIN_SECRET }}
NODE_TLS_REJECT_UNAUTHORIZED: 0
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'npm'
- name: Run E2E tests
uses: cypress-io/github-action@v4
with:
start: npm exec vite --port ${{ env.PORT }} --host 127.0.0.1
build: npm run build
wait-on: https://127.0.0.1:${{ env.PORT }}
wait-on-timeout: 20
browser: chrome
env:
PORT: 3002
CYPRESS_RECORD_KEY: ${{ vars.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Component tests
uses: cypress-io/github-action@v4
with:
install: false
component: true
browser: chrome