-
Notifications
You must be signed in to change notification settings - Fork 85
175 lines (143 loc) · 4.02 KB
/
integration.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Integration
on:
workflow_dispatch:
push:
branches:
- master
- develop
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**.md'
- 'docs/**'
env:
NODE_VERSION: 18.16.0
NODE_OPTIONS: --max_old_space_size=10240
ICM_BASE_URL: https://review.icm.intershop.de
jobs:
CancelPrevious:
runs-on: ubuntu-latest
steps:
- name: Cancel Old Pipeline
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop'"
uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Build:
needs: [CancelPrevious]
runs-on: ubuntu-latest
env:
TESTING: true
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- name: Install root dependencies
run: npm ci
- name: Disable ServiceWorker
run: node schematics/customization/service-worker false
- name: Build SSR
run: npm run build:multi
- name: Upload Build Output
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
Universal:
needs: [Build]
runs-on: ubuntu-latest
strategy:
matrix:
test: ['b2c', 'b2b']
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- name: Download Build Output
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Set Environment
run: |
echo "LOGGING=true" >> $GITHUB_ENV
- name: Set B2C Environment
if: matrix.test == 'b2c'
run: |
echo "THEME=b2c" >> $GITHUB_ENV
- name: Set B2B Environment
if: matrix.test == 'b2b'
run: |
echo "THEME=b2b" >> $GITHUB_ENV
- name: Test Universal
run: |
node dist/$THEME/run-standalone &
sh e2e/test-universal.sh
Cypress:
needs: [Build, Universal]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test: ['b2c', 'b2b']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install e2e dependencies
run: cd e2e && npm i
- name: Download Build Output
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Set Environment
run: |
echo "PWA_BASE_URL=http://localhost:4200" >> $GITHUB_ENV
echo "LOGGING=true" >> $GITHUB_ENV
echo "BROWSER=chrome" >> $GITHUB_ENV
- name: Set B2C Environment
if: matrix.test == 'b2c'
run: |
echo "THEME=b2c" >> $GITHUB_ENV
- name: Set B2B Environment
if: matrix.test == 'b2b'
run: |
echo "THEME=b2b" >> $GITHUB_ENV
- name: Start SSR
run: |
node dist/$THEME/run-standalone &
- name: Cypress
uses: cypress-io/github-action@v6
with:
install: false
wait-on: 'http://localhost:4200'
wait-on-timeout: 180
working-directory: e2e
command: npx ts-node cypress-ci-e2e **/*${{ matrix.test }}*.e2e-spec.ts
- name: Upload Screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshots
path: e2e/cypress/screenshots
- name: Upload Videos
uses: actions/upload-artifact@v3
if: failure()
with:
name: videos
path: e2e/cypress/videos
Shellspec:
needs: [CancelPrevious]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Execute shellspec tests
run: |
docker run --rm -v "${{ github.workspace }}/nginx/docker-entrypoint.d:/src" shellspec/shellspec