-
Notifications
You must be signed in to change notification settings - Fork 7
91 lines (86 loc) · 2.36 KB
/
front-office-tests.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
name: Cypress tests
on:
push:
paths:
- 'daikoku/app/**'
- 'daikoku/javascript/**'
- '.github/workflows/front-office-tests.yml'
workflow_dispatch:
jobs:
cypress-run:
name: Cypress run
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: daikoku_test
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v2.2.0
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# install node 16
- name: setup node
uses: actions/setup-node@v1
with:
node-version: '16'
- uses: coursier/cache-action@v5
- name: initialize backend build
run: |
cd daikoku
sbt ';clean;compile'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: |
echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: CACHE ACTION
uses: actions/cache@v2
env:
cache-version: v1
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-${{ env.cache-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ env.cache-version }}-
${{ runner.os }}-yarn-
${{ runner.os }}-
- name: Installing dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: |
cd daikoku/javascript
echo "YARN CACHE CHANGED"
rm -rf node_modules/
yarn install
- name: build javascript
run: |
cd daikoku/javascript
yarn build
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Cypress run and publish report
uses: cypress-io/github-action@v2
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
with:
browser: chrome
headless: true
start: yarn cypress:start:backend
wait-on: 'http://localhost:9000'
command: yarn test:cypress
working-directory: daikoku/javascript