-
Notifications
You must be signed in to change notification settings - Fork 22
92 lines (75 loc) · 2.44 KB
/
nodejs.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
92
name: Vue 3 CI/CD
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Build and test
run: |
npm run build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
flags: unittests
env:
CI: true
VUE_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }}
VUE_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }}
VUE_APP_URL_ENDPOINT: ${{ secrets.ik_url_endpoint }}
e2e:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm install
npm run build
- name: Build Test app
run: |
cd tests/test-app
echo VUE_APP_URL_ENDPOINT = ${{ secrets.ik_url_endpoint }} > .env;
echo VUE_APP_PUBLIC_KEY = ${{ secrets.ik_public_key }} >> .env;
echo VUE_APP_AUTHENTICATION_ENDPOINT = 'http://localhost:3001/auth' >> .env;
npm install
npm run build
cd server
echo VUE_APP_PRIVATE_KEY = ${{ secrets.ik_private_key }} > .env;
npm install
- name: Start the app for Cypress
run: |
npm run start:test-app > /dev/null 2>&1 &
echo "App started successfully"
npx wait-on http://localhost:3000
echo "App is ready"
- name: Run E2E tests
uses: cypress-io/github-action@v4
with:
wait-on: http://localhost:3000
env:
DEBUG: 'cypress:server:browsers:electron'
CI: true
VUE_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }}
VUE_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }}
VUE_APP_URL_ENDPOINT: ${{ secrets.ik_url_endpoint }}
VUE_APP_AUTHENTICATION_ENDPOINT: http://localhost:3001/auth