generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 35
135 lines (113 loc) · 4.03 KB
/
e2e.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: E2E
on: [pull_request]
env:
CACHE_DIST_KEY: dist-${{ github.ref }}-${{ github.sha }}
CYPRESS_CACHE_FOLDER: ./node_modules/cache-cypress
UNIVERSAL_SERVER: http://localhost:4000
STATIC_SERVER: http://localhost:8080
jobs:
build-demo:
name: Build demo
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 10
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npx tsc --project projects/demo-integrations/tsconfig.json
- name: Mark demo-app directory for persist in cache
uses: actions/cache@v4
with:
path: dist/demo
key: ${{ env.CACHE_DIST_KEY }}
- name: Build demo
# --optimization false to keep `window.ng` inside Cypress tests
run: npm run build -- --optimization false
- name: Build SSR server
run: npm run build:ssr
e2e-kit:
needs: [build-demo]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: [date, date-range, date-time, number, time]
name: Kit / ${{ matrix.project }}
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- name: Download demo build from cache
uses: actions/cache@v4
with:
path: dist/demo
key: ${{ env.CACHE_DIST_KEY }}
- name: Serving SSR server
run: |
npm run serve:ssr -- --ci & sleep 5
curl -X GET -I -f "${{ env.UNIVERSAL_SERVER }}"
- name: Run Cypress tests
run:
npx nx e2e demo-integrations --spec="**/kit/${{ matrix.project }}/**/*.cy.ts" --baseUrl=${{
env.UNIVERSAL_SERVER}}
e2e-recipes:
needs: [build-demo]
runs-on: ubuntu-latest
name: Recipes
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- name: Download demo build from cache
uses: actions/cache@v4
with:
path: dist/demo
key: ${{ env.CACHE_DIST_KEY }}
- name: Serving SSR server
run: |
npm run serve:ssr -- --ci & sleep 5
curl -X GET -I -f "${{ env.UNIVERSAL_SERVER }}"
- name: Run Cypress tests
run: npx nx e2e demo-integrations --spec="**/recipes/**/*.cy.ts" --baseUrl=${{ env.UNIVERSAL_SERVER}}
e2e-others:
needs: [build-demo]
runs-on: ubuntu-latest
name: Others
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- name: Download demo build from cache
uses: actions/cache@v4
with:
path: dist/demo
key: ${{ env.CACHE_DIST_KEY }}
- name: Serving SSR server
run: |
npm run serve:ssr -- --ci & sleep 5
curl -X GET -I -f "${{ env.UNIVERSAL_SERVER }}"
- name: Run Cypress tests
# Replace with npm run cy:run -- --spec "**/!(kit|recipes)/*.cy.ts" --config baseUrl="${{ env.UNIVERSAL_SERVER }}"
# After this issue fix: https://github.com/cypress-io/cypress/issues/22407
run:
npx nx e2e demo-integrations --spec="**/(angular|react|ssr|addons|others)/**/*.cy.ts" --baseUrl=${{
env.UNIVERSAL_SERVER}}
component-testing:
runs-on: ubuntu-latest
name: Component Testing
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- name: Run Cypress tests
run: npx nx component-test demo-integrations --browser=chrome
result:
needs: [build-demo, e2e-kit, e2e-recipes, e2e-others, component-testing]
runs-on: ubuntu-latest
name: E2E result
steps:
- run: echo "Success"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true