This repository was archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (83 loc) · 2.75 KB
/
Copy pathtests.yml
File metadata and controls
98 lines (83 loc) · 2.75 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
name: Tests
on: push
jobs:
test:
name: Test with Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 15]
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
#Generate a certificate (Used by frontend and cor)
- name: Generate Certificate
run: openssl req -newkey rsa:2048 -nodes -x509 -subj "/CN=127.0.0.1" -addext "subjectAltName = IP:127.0.0.1" -keyout key.pem -out cert.cer
#Setup the frontend
- name: Clone frontend
uses: actions/checkout@v2
with:
repository: 'cloud-cnc/frontend'
path: frontend
- name: Install frontend modules
working-directory: ./frontend
run: sudo npm ci --unsafe-perm=true --allow-root
#Run ESlint on the frontend
- name: ESlint
working-directory: ./frontend
run: npm run lint
- name: Link frontend TLS certificate
working-directory: ./frontend/config
run: |
ln -s ../../cert.cer ./
ln -s ../../key.pem ./
#Setup the controller
- name: Clone controller
uses: actions/checkout@v2
with:
repository: 'cloud-cnc/controller'
path: controller
- name: Install controller modules
working-directory: ./controller
run: sudo npm ci --unsafe-perm=true --allow-root
#Used to whitelist the self signed certificate
- name: Link controller TLS certificate
working-directory: ./controller/config
run: |
ln -s ../../cert.cer ./
#Setup the core
- name: Enable MongoDB
run: sudo systemctl start mongod
- name: Install & Enable RedisDB
run: |
sudo apt install redis-server
sudo systemctl start redis-server
- name: Clone core
uses: actions/checkout@v2
with:
repository: 'cloud-cnc/core'
path: core
- name: Install core modules
working-directory: ./core
run: sudo npm ci --unsafe-perm=true --allow-root
- name: Link core TLS certificate
working-directory: ./core/config
run: |
ln -s ../../cert.cer ./
ln -s ../../key.pem ./
#Run unit + E2E tests
- uses: paambaati/codeclimate-action@v2.7.4
name: Run Tests
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_REPORTER_ID }}
with:
coverageCommand: sudo npm run coverage --prefix frontend
coverageLocations: ./frontend/coverage
#Archive E2E videos on fail
- uses: actions/upload-artifact@v2
name: Archive E2E videos
if: ${{ failure() }}
with:
name: e2e-videos
path: ./frontend/tests/e2e/videos/