-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (56 loc) · 1.7 KB
/
frontend-test-action.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
name: 'Frontend tests'
on: [push]
jobs:
unit-tests:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: frontend
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.17.1
- name: Npm install
run: npm ci
- name: Run unit tests
run: npm test
e2e:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- uses: abhi1693/[email protected]
with:
browser: chrome
version: latest
- name: run keycloak docker
run: |
docker run -d \
--name my_keycloak \
-e KEYCLOAK_ADMIN=admin \
-e KEYCLOAK_ADMIN_PASSWORD=keycloak \
-v ./docker/config/realm-export.json:/opt/keycloak/data/import/realm.json \
-p 8544:8080 \
quay.io/keycloak/keycloak:23.0.1 \
start-dev --import-realm
- name: start backend
run: cd ./backend && mvn spring-boot:run -Dspring-boot.run.profiles=integration-test &
- name: Cypress run e2e tests
uses: cypress-io/github-action@v6
with:
working-directory: frontend
start: npm start
wait-on: 'http://localhost:8080/config, http://localhost:4200, http://localhost:8544'
wait-on-timeout: 120
browser: chrome
headed: true
- name: remove docker containers
run: docker ps -aq | xargs -r docker rm -f