-
Notifications
You must be signed in to change notification settings - Fork 306
67 lines (54 loc) · 1.68 KB
/
ci-cd.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
name: CI/CD Pipeline
on:
push:
branches:
- release-8.0.0
pull_request:
branches:
- release-8.0.0
jobs:
build:
runs-on: ubuntu-latest
container:
image: cimg/node:20.9.0
steps:
- name: Checkout repository
uses: actions/checkout@v4
# - name: Run build script
# run: /bin/bash -x build.sh ${{ github.sha }} test test test test test
test_cases:
runs-on: ubuntu-latest
container:
image: cimg/node:20.9.0
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: portal
- name: Set working directory
run: cd ./portal/src/app/client
- name: Check Node.js version
run: node --version
- name: Ignore engines
run: yarn config set ignore-engines true
- name: Install npm dependencies
run: yarn install
- name: Cache node modules
uses: actions/cache@v2
with:
path: portal/src/app/client/node_modules
key: dependency-cache-portal-${{ hashFiles('portal/src/app/client/package.json') }}
restore-keys: |
dependency-cache-portal-
- name: Execute test cases using JEST
run: npm run test-coverage
working-directory: portal/src/app/client
- name: Install Sonar Scanner
run: |
cd /tmp
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
sudo apt-get install unzip -y
unzip sonar-scanner-cli-5.0.1.3006-linux.zip
cd -
- name: Run Sonar Scanner
run: cd portal && /tmp/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner