-
Notifications
You must be signed in to change notification settings - Fork 34
125 lines (108 loc) · 3.07 KB
/
test_visualization.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
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
name: Visualization Tests
on:
push:
branches:
- main
paths-ignore:
- 'analysis/**'
- 'gh-pages/**'
- '**/*.md'
pull_request:
branches:
- main
paths-ignore:
- 'analysis/**'
- 'gh-pages/**'
- '**/*.md'
jobs:
build_visualization_test:
name: Unit Tests (Visualization)
runs-on: ubuntu-latest
env:
working-directory: ./visualization
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install node
run: npm ci
working-directory: ${{env.working-directory}}
- name: Run unit tests
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
npm run test:ci
working-directory: ${{env.working-directory}}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: ./visualization/dist/
build_visualization_e2e:
name: E2E Tests (Visualization)
runs-on: ubuntu-latest
env:
working-directory: ./visualization
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install node
run: npm ci
working-directory: ${{env.working-directory}}
- name: Build and run e2e tests
env:
PUPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome"
run: |
npm run build
npm run e2e:ci
working-directory: ${{env.working-directory}}
publish_sonar_visualization:
needs: [build_visualization_test, build_visualization_e2e]
name: "Code Quality Results (visualization)"
runs-on: ubuntu-latest
env:
working-directory: ./visualization
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: coverage
path: ./visualization/dist/
- name: SonarCloud Scan
uses: SonarSource/[email protected]
with:
projectBaseDir: ./visualization
args: >
-Dsonar.javascript.lcov.reportPaths=./dist/coverage/lcov.info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}