adding mysql setup to tests
This commit is contained in:
parent
67bbad0801
commit
1667fc1bbd
28
.github/workflows/build.yml
vendored
28
.github/workflows/build.yml
vendored
@ -10,10 +10,23 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [10.x, 12.x, 13.x]
|
node-version: [10.x, 12.x, 13.x]
|
||||||
|
|
||||||
|
services:
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:latest
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
env:
|
||||||
|
MYSQL_USER: user
|
||||||
|
MYSQL_PASSWORD: password
|
||||||
|
MYSQL_DATABASE: test
|
||||||
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
@ -21,12 +34,25 @@ jobs:
|
|||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
|
- name: Verify MariaDB connection
|
||||||
|
env:
|
||||||
|
PORT: ${{ job.services.mariadb.ports[3306] }}
|
||||||
|
run: |
|
||||||
|
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
- name: npm install, build, and test
|
- name: npm install, build, and test
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
npm run build --if-present
|
npm run build --if-present
|
||||||
npm test
|
npm test
|
||||||
env:
|
env:
|
||||||
|
MYSQL_HOST: localhost
|
||||||
|
MYSQL_USER: user
|
||||||
|
MYSQL_PASSWORD: password
|
||||||
|
MYSQL_DATABASE: pigalelry_test
|
||||||
PORT: 35000
|
PORT: 35000
|
||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user