-
Notifications
You must be signed in to change notification settings - Fork 11
181 lines (169 loc) · 7.17 KB
/
Copy pathfrontend.js.yml
File metadata and controls
181 lines (169 loc) · 7.17 KB
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
176
177
178
179
180
181
name: Testing without FF!
on:
push:
branches:
- master
pull_request:
jobs:
frontend:
strategy:
fail-fast: false
matrix:
include:
- spring-profile: none
selected-specs: cypress/e2e/no-profile/**
authenticationTest: no-authentication
- spring-profile: storage.xml
selected-specs: cypress/e2e/storage-xml/**
authenticationTest: no-authentication
- spring-profile: none
selected-specs: cypress/e2e/production-auth/**
authenticationTest: production
- spring-profile: none
selected-specs: cypress/e2e/backend-auth/**
authenticationTest: only-backend
name: Test ladybug without FF!, spring-profile = ${{ matrix.spring-profile }}, authenticationTest = ${{ matrix.authenticationTest }}
runs-on: ubuntu-latest
steps:
- name: Show chosen Spring profile for backend and chosen specs to run
run: echo "Start backend with Spring profile ${{ matrix.spring-profile }} and run specs ${{ matrix.selected-specs }}"
- name: Checkout ladybug
uses: actions/checkout@v2
with:
repository: wearefrank/ladybug
path: ladybug
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.4
run_install: false
- name: Get pnpm store directory
id: store-path
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.store-path.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Show pnpm version (before pnpm install)
run: pnpm -v
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: 'ladybug/ladybug-frontend/pnpm-lock.yaml'
- uses: actions/cache@v4
name: Cache Cypress
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-cypress-
- name: Install Cypress
run: npx cypress install
working-directory: ladybug/ladybug-frontend
- name: Set Cypress environment variables
run: cp .github/workflows/cypress.env.json.cicd ladybug-frontend/cypress.env.json
working-directory: ladybug
- name: Enable ladybug.ui.test.mode
if: ${{ matrix.authenticationTest == 'only-backend' }}
working-directory: ladybug
run: cp .github/workflows/test-auth-only-backend.properties ladybug-test-webapp/src/main/resources/test.properties
- name: Enable authentication - produce temp web.xml
if: ${{ matrix.authenticationTest != 'no-authentication' }}
working-directory: ladybug/ladybug-test-webapp/src/main/webapp/WEB-INF
run: grep -v "CICD_AUTH" web.xml > web.xml.out
- name: Enable authentication - copy temp web.xml back
if: ${{ matrix.authenticationTest != 'no-authentication' }}
working-directory: ladybug/ladybug-test-webapp/src/main/webapp/WEB-INF
run: cp web.xml.out web.xml
- name: Checkout frank-runner
uses: actions/checkout@v2
with:
repository: wearefrank/frank-runner
path: frank-runner
- name: Set property to skip backend unit tests
run: echo "maven.skip.tests=true" > frank-runner/specials/ladybug/build.properties
- name: Set properties to skip backend Javadoc
run: echo "maven.skip.javadoc=true" >> frank-runner/specials/ladybug/build.properties
- name: Set property to skip checking licenses
run: echo "maven.skip.copyright=true" >> frank-runner/specials/ladybug/build.properties
- name: Choose Spring profile for backend if it is not "none"
run: echo "spring.profiles.active=${{ matrix.spring-profile }}" >> frank-runner/specials/ladybug/build.properties
if: ${{ matrix.spring-profile != 'none' }}
- name: Set port where ladybug-test-webapp is served
run: echo "tomcat.connector.port=8090" > frank-runner/build.properties
- name: Prevent Java exception about binding port 443 (for https)
run: echo "tomcat.secure.port=8443" >> frank-runner/build.properties
- name: Make script executable that starts backend
run: chmod a+x frank-runner/specials/ladybug/restart.sh
- name: Cache Frank!Runner dependencies - build
uses: actions/cache@v3
with:
path: frank-runner/build
key: ${{ runner.os }}-frank-runner-build
restore-keys: |
${{ runner.os }}-frank-runner-build
- name: Cache Frank!Runner dependencies - download
uses: actions/cache@v3
with:
path: frank-runner/download
key: ${{ runner.os }}-frank-runner-download
restore-keys: |
${{ runner.os }}-frank-runner-download
- name: Cache Maven downloads
uses: actions/cache@v3
with:
path: ~/.m2/repository/
key: ${{ runner.os }}-maven
restore-keys: |
${{ runner.os }}-maven
- name: Remove old Tomcat version to keep it out of cache
run: rm -rf frank-runner/download/apache-tomcat-9*; rm -rf frank-runner/build/apache-tomcat-9*;
- name: Show current time, allows you to check that logs are not old
run: date
- name: Remove old catalina.out
run: rm -rf frank-runner/build/apache-tomcat-9.0.56/logs/catalina.out
- name: Let Frank!Runner do its downloads
run: ./env.sh > installFrankRunnerEnv.log
working-directory: frank-runner
- name: Start server using Frank!Runner
run: ./restart.sh
working-directory: frank-runner/specials/ladybug
- name: Wait for server to be available
working-directory: ladybug/.github/workflows
run: ./waitForUrl.sh http://localhost:8090 300
- name: Run cypress with chrome browser
uses: cypress-io/github-action@v6.6.0
with:
working-directory: ladybug/ladybug-frontend
spec: ${{ matrix.selected-specs }}
config: baseUrl=http://localhost:8090/ladybug
browser: chrome
- name: Show files
run: tree -d -L 5 .
if: failure()
- name: Store logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs and videos ${{ matrix.spring-profile }}
path: |
frank-runner/specials/ladybug/build.properties
frank-runner/build/*/logs/*
ladybug/ladybug-frontend/cypress/screenshots/
ladybug/ladybug-frontend/cypress/videos/
ladybug/ladybug-frontend/cypress/firefox/screenshots/
ladybug/ladybug-frontend/cypress/firefox/videos/
- name: Store logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: installFrankRunnerEnv ${{ matrix.spring-profile }}
path: |
frank-runner/installFrankRunnerEnv.log