-
Notifications
You must be signed in to change notification settings - Fork 36
52 lines (51 loc) · 1.98 KB
/
ci.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
name: CI
on:
push:
branches:
- main
- dev
- release-*
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- release-*
jobs:
CI:
strategy:
matrix:
# node-version: [10.x, 12.x, 14.x]
node-version: [14.x]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up nodejs version ${{ matrix.node-version }}
uses: actions/setup-node@v3.2.0
with:
node-version: ${{ matrix.node-version }}
- name: Set up MySQL Database
uses: mirromutth/mysql-action@v1.1
with:
# host port: 3800 # Optional, default value is 3306. The port of host
# container port: 3307 # Optional, default value is 3306. The port of container
character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld
mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL
mysql database: 'rest_api' # Optional, default value is "test". The specified database which will be create
mysql root password: root # Required if "mysql user" is empty, default is empty. The root superuser password
mysql user: 'user' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too
mysql password: root # Required if "mysql user" exists. The password for the "mysql user"
- name: Install package
run: npm install
- name: Linter
run: npm run lint
- name: Build
run: npm run build --if-present
- name: Test
run: npm run test
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}