-
Notifications
You must be signed in to change notification settings - Fork 183
72 lines (69 loc) · 2.12 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Continous Integration
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
env:
CI: true
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [16, 18, 20]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: ankane/setup-mysql@v1
with:
mysql-version: 8.0
- run: |
sudo mysql -e "CREATE USER '${{ secrets.MYSQL_USER }}'@'localhost' IDENTIFIED BY '${{ secrets.MYSQL_PASSWORD }}'"
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '${{ secrets.MYSQL_USER }}'@'localhost'"
sudo mysql -u root -e "ALTER USER '${{ secrets.MYSQL_USER }}'@'localhost' IDENTIFIED WITH mysql_native_password by '${{ secrets.MYSQL_PASSWORD }}'"
sudo mysql -u root -e "FLUSH PRIVILEGES"
- run: npm install
- run: npm test
env:
MYSQL_HOST: '127.0.0.1'
MYSQL_USER: ${{ secrets.MYSQL_USER }}
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
CI: true
code-lint:
name: Code Lint
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Bootstrap project
run: |
npm ci --ignore-scripts
- name: Verify code linting
run: npm run lint
commit-lint:
name: Commit Lint
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Bootstrap project
run: |
npm ci --ignore-scripts
- name: Verify commit linting
run: npx commitlint --from origin/master --to HEAD --verbose