-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (58 loc) · 1.73 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: 🏗️ Build @last9/openapm
on:
push:
branches:
- '*'
jobs:
release:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: 18.19.0
- uses: shogo82148/[email protected]
with:
mysql-version: '8.0'
- uses: harmon758/postgresql-action@v1
with:
postgresql version: '14'
postgresql user: 'tester'
postgresql password: 'password'
- name: Test MySQL Connection
run: mysql -h localhost -u root -e 'SELECT version()'
- name: Test Postgres Connection
run: psql
- name: Create test DB
run: mysql -h localhost -u root -e 'CREATE DATABASE test_db'
- name: Create test DB
run: psql -h localhost -U tester -c 'CREATE DATABASE testdb'
- 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: 📦 Install Playwright Deps
run: npx playwright install --with-deps
- 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