-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (47 loc) · 1.32 KB
/
build.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
name: 🏗️ Build @last9/openapm
on:
push:
branches:
- '*'
jobs:
release:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: 16.20.0
- uses: shogo82148/actions-setup-mysql@v1.23.0
with:
mysql-version: '8.0'
- name: Test MySQL Connection
run: mysql -h localhost -u root -e 'SELECT version()'
- name: Create test DB
run: mysql -h localhost -u root -e 'CREATE DATABASE test_db'
- name: 🛎 Checkout
uses: actions/checkout@v3
- name: 🧶 Get NPM cache
uses: actions/cache@v3
id: cache-npm
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 dependencies
run: npm install --frozen-lockfile
- name: 🧪 Test
env:
DB_HOST: localhost
DB_PORT: 3306
DB_NAME: test_db
DB_USER: root
CI: true
run: npm run test
- name: 👷 Build
run: npm run build