-
Notifications
You must be signed in to change notification settings - Fork 306
65 lines (52 loc) · 1.9 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
name: CI/CD
on:
push:
branches:
- release-8.0.0
pull_request:
branches:
- release-8.0.0
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.20.2'
- name: Install yarn
run: npm install -g yarn
- name: Clean and install client dependencies
run: |
cd src/app/client
yarn cache clean
yarn install --no-progress --production=true
- name: Build client
run: npm run build
working-directory: src/app/client
- name: Prepare server directory
run: |
mkdir -p $GITHUB_WORKSPACE/app_dist
cp -r src/app/libs src/app/helpers src/app/proxy src/app/resourcebundles src/app/package.json src/app/framework.config.js src/app/sunbird-plugins src/app/routes src/app/constants src/app/controllers src/app/server.js $GITHUB_WORKSPACE/app_dist/
- name: Install server dependencies
run: yarn install --ignore-engines --no-progress --production=true
working-directory: $GITHUB_WORKSPACE/app_dist
- name: Build and run server scripts
run: |
mv dist/index.html dist/index.ejs
node helpers/resourceBundles/build.js -task="phraseAppPull"
working-directory: $GITHUB_WORKSPACE/app_dist
- name: Run tests
run: npm run test:ci
working-directory: 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
unzip sonar-scanner-cli-5.0.1.3006-linux.zip
cd -
- name: Run Sonar Scanner
run: /tmp/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner
working-directory: $GITHUB_WORKSPACE