-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (112 loc) · 3.74 KB
/
tests.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Continuous Integration
on:
pull_request:
types: [ opened, reopened, synchronize ]
env:
NODE_APP_INSTANCE: "imp"
NODE_CONFIG_ENV: "test"
NODE_TLS_REJECT_UNAUTHORIZED: 0
CI_TESTS: true
jobs:
test-lint:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Install
uses: bahmutov/npm-install@v1
- name: Run ESlint
run: |
yarn lint
test-unit:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Checkout and sync "icmaa/shop-workspace" repo
run: |
yarn global add @icmaa/config-sync
export CONFIG_BRANCH=$(if [[ ${{ github.base_ref }} =~ ^master ]]; then echo "-b master"; fi)
config-sync -t ${{ secrets.PAT }} -r vue-storefront $CONFIG_BRANCH -d ./
- name: Install
uses: bahmutov/npm-install@v1
- name: Run Jest-Unit-Tests
run: |
yarn test:unit
tests-e2e:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers: [ 'runner-1', 'runner-2', 'runner-3', 'runner-4', 'runner-5' ]
services:
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server
env:
VSF_REDIS_HOST: localhost
VSF_REDIS_PORT: 6379
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Checkout and sync "icmaa/shop-workspace" repo
run: |
yarn global add @icmaa/config-sync
export CONFIG_BRANCH=$(if [[ ${{ github.base_ref }} =~ ^master ]]; then echo "-b master"; fi)
config-sync -t ${{ secrets.PAT }} -r vue-storefront $CONFIG_BRANCH -d ./
# - name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: echo "$GITHUB_CONTEXT"
- name: Install
uses: bahmutov/npm-install@v1
- name: Build
run: yarn build
- name: Start
env:
VSF_STORYBLOK_RELEASE_ID: ${{ secrets.STORYBLOK_RELEASE_ID }}
run: |
yarn start:pm2 &
- name: Cypress run
uses: cypress-io/github-action@v5.7.2
id: cypress
timeout-minutes: 5
with:
working-directory: src/themes/icmaa-imp/test/e2e
wait-on: http://localhost:3000
wait-on-timeout: 120
browser: chrome
# spec: integration/Cms/**/*
record: true
parallel: true
group: ci-${{ runner.os }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.sha }}
tag: ${{ github.event_name }},${{ github.event_name }}/${{ github.event.action }}
ci-build-id: 'ci-${{ github.sha }}-${{ github.run_id }}-${{ github.run_number }}'
env:
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_RECORD_KEY}}
CYPRESS_PROJECT_ID: ${{secrets.CYPRESS_PROJECT_ID}}
- name: Dump and consolidate outputs
if: failure()
run: |
mkdir artifacts
yarn pm2 logs --format --nostream --lines 10000000 > artifacts/server.log
rsync -avzr --ignore-missing-args src/themes/icmaa-imp/test/e2e/screenshots src/themes/icmaa-imp/test/e2e/videos dist/log ./artifacts/
- name: Upload artifacts
uses: actions/upload-artifact@v1
if: failure()
with:
name: build
path: artifacts