-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (90 loc) · 2.6 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
name: CI
on:
pull_request:
push:
branches:
- main
env:
CYPRESS_CACHE_FOLDER: ${{ github.workspace }}/node_modules/.cypress
PERCY_POSTINSTALL_BROWSER: true
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup_node
- uses: ./.github/actions/code_generate
lint:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup_node
- uses: ./.github/actions/code_generate
- run: pnpm lint
frontend-test:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup_node
- uses: ./.github/actions/code_generate
- run: |
cd packages/frontend
pnpm test
bff-test:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup_node
- uses: ./.github/actions/code_generate
- run: |
cd packages/bff
pnpm test
generate-percy-nonce:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.nonce.outputs.result }}
steps:
- id: nonce
run: echo "::set-output name=result::${{ github.run_id }}-$(date +%s)"
headless-browser-test:
needs: [prepare, generate-percy-nonce]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
parallelism: [1,2]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup_node
- uses: ./.github/actions/code_generate
- name: faking npx
run: |
npx=$(which npx)
pnpm=$(which pnpm)
mv ${npx} ${npx}.org
ln -s ${pnpm} ${npx}
- name: headless browser test
uses: cypress-io/github-action@v2
with:
install: false
record: true
parallel: true
working-directory: packages/frontend
start: pnpm dev:serve
wait-on: http://localhost:3000/
command-prefix: percy exec --
config: video=false
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
PERCY_PARALLEL_TOTAL: ${{ strategy.job-total }}
PERCY_PARALLEL_NONCE: ${{ needs.generate-percy-nonce.outputs.result }}
NEXT_PUBLIC_ENABLE_MSW: enabled
NEXT_PUBLIC_GRAPHQL_URL: http://localhost:9999/dummy/graphql
NEXT_PUBLIC_WS_GRAPHQL_URL: ws://localhost:9999/dummy/graphql
CYPRESS_BASE_URL: http://localhost:3000/
CYPRESS_CACHE_FOLDER: ${{ github.workspace }}/node_modules/.cypress
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}