This repository was archived by the owner on Apr 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
125 lines (120 loc) · 3.7 KB
/
ci-actions.yml
File metadata and controls
125 lines (120 loc) · 3.7 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
name: CI
on:
push:
branches-ignore:
- "dependabot/**"
pull_request:
paths-ignore:
- "README.md"
jobs:
unit-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.4.0
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: yarn build
- run: yarn test --coverage --watchAll=false
- uses: codecov/codecov-action@v2.0.3
with:
flags: unitests
e2e:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
browser: [chrome, firefox]
services:
keycloak:
image: quay.io/projectopenubl/openubl-keycloak-theme:latest
ports:
- 8180:8080
env:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
options: >-
--health-cmd "curl --fail http://localhost:8080/auth || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
backend-db:
image: postgres:13.1
ports:
- 5432:5432
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: ublhub_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
backend:
image: quay.io/projectopenubl/ublhub:master
ports:
- 8080:8080
env:
QUARKUS_DATASOURCE_USERNAME: user
QUARKUS_DATASOURCE_PASSWORD: password
QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://backend-db:5432/ublhub_db
QUARKUS_OIDC_AUTH_SERVER_URL: http://keycloak:8080/auth/realms/openubl
QUARKUS_OIDC_CLIENT_ID: xsender
QUARKUS_OIDC_CREDENTIALS_SECRET: secret
options: >-
--health-cmd "curl --fail http://localhost:8080 || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v2
# - name: Keycloak Admin CLI
# uses: carlosthe19916/keycloak-action@master
# with:
# server: http://keycloak:8080/auth
# username: admin
# password: admin
# cmd: create realms -f openubl-realm.json
- run: yarn install
- run: yarn build:instrumentation
- uses: haya14busa/action-cond@v1
id: define_tags
with:
cond: ${{ env.CYPRESS_RECORD_KEY != null }}
if_true: ${{ matrix.os }}-${{ matrix.browser }}
if_false: null
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
- name: Cypress run
uses: cypress-io/github-action@v2
with:
record: ${{ env.CYPRESS_RECORD_KEY != null }}
tag: ${{ steps.define_tags.outputs.value }}
start: yarn run xsender:ui
wait-on: "http://localhost:3000"
wait-on-timeout: 120
config: pageLoadTimeout=100000
browser: ${{ matrix.browser }}
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v2.2.4
if: failure()
with:
name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }}
path: cypress/screenshots
- uses: actions/upload-artifact@v2.2.4
if: always()
with:
name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }}
path: cypress/videos
- uses: codecov/codecov-action@v2.0.3
with:
flags: e2etests