-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (118 loc) · 3.63 KB
/
ui-workflow.yaml
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
name: Lagoon UI CI
on:
pull_request:
branches:
- main
push:
branches:
- main
- cypress-test
jobs:
format-check:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: yarn
- name: Checkout Repository
uses: actions/checkout@v4
- name: Formatting check
run: |
yarn add [email protected] @trivago/prettier-plugin-sort-imports
yarn format-check
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Linting
run: |
yarn add [email protected]
yarn lint
cypress-tests:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
lagoon_image_tag: ["main"]
lagoon_image_repo: ["testlagoon"]
experimental: [false]
# include:
# - lagoon_image_tag: "v2.20.1"
# lagoon_image_repo: "uselagoon"
# experimental: true
# needs: [format-check, lint]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build and start Lagoon-minimal
run: |
make development-api LAGOON_CORE_IMAGE_REPO=${{matrix.lagoon_image_repo}} LAGOON_CORE_IMAGE_TAG=${{matrix.lagoon_image_tag}}
- name: Start ui
env:
GRAPHQL_API: http://localhost:3000/graphql
KEYCLOAK_API: http://localhost:8088/auth
NODE_PORT: 3003
run: |
yarn install
yarn build
yarn start &
- name: Run RBAC Cypress Tests
uses: cypress-io/github-action@v6
with:
config-file: ./cypress/cypress.config.ts
auto-cancel-after-failures: 1
wait-on: 'http://localhost:3003'
command: yarn cypress:runRbac
env:
cypress_api: http://localhost:3000/graphql
cypress_keycloak: http://localhost:8088/auth
cypress_url: http://localhost:3003
- name: Run Organization Cypress Tests
uses: cypress-io/github-action@v6
with:
config-file: ./cypress/cypress.config.ts
auto-cancel-after-failures: 1
wait-on: 'http://localhost:3003'
command: yarn cypress:runOrganizations
env:
cypress_api: http://localhost:3000/graphql
cypress_keycloak: http://localhost:8088/auth
cypress_url: http://localhost:3003
- name: Run General Cypress Tests
uses: cypress-io/github-action@v6
with:
config-file: ./cypress/cypress.config.ts
auto-cancel-after-failures: 1
wait-on: 'http://localhost:3003'
command: yarn cypress:runGeneral
env:
cypress_api: http://localhost:3000/graphql
cypress_keycloak: http://localhost:8088/auth
cypress_url: http://localhost:3003
- name: Export API logs on failure
if: failure()
run: |
docker compose -p core-lagoon-ui logs api
- name: Save screenshots on failure
uses: actions/upload-artifact@v4
# add the line below to store screenshots only on failures
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
- name: Save videos on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
path: cypress/videos
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
- name: Stop Docker containers
run: |
make development-api-down