Skip to content

Commit 8ba3af7

Browse files
Seed the test db
1 parent 1e50f57 commit 8ba3af7

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,22 @@ jobs:
3030
MYSQL_ROOT_PASSWORD: "itsasekret_ci_6g9b75t2gt528az"
3131
MYSQL_DATABASE: "senecatest_ci_578gw9f6wf7"
3232

33+
# NOTE: This is a healthcheck.
34+
#
35+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
36+
3337
steps:
3438
- uses: actions/checkout@v2
3539
- name: Use Node.js ${{ matrix.node-version }}
3640
uses: actions/setup-node@v1
3741
with:
3842
node-version: ${{ matrix.node-version }}
43+
- run: mysql "${CI_DB_NAME}" --host="${CI_DB_HOST}" --user="${CI_DB_USER}" --password="${CI_DB_PASSWORD}" --port="${CI_DB_PORT}" < ./test/support/db/seed/schema.sql
44+
env:
45+
CI_DB_NAME: "senecatest_ci_578gw9f6wf7"
46+
CI_DB_HOST: "127.0.0.1"
47+
CI_DB_USER: "root"
48+
CI_DB_PASSWORD: "itsasekret_ci_6g9b75t2gt528az"
49+
CI_DB_PORT: ${{ job.services.mysql.ports['3306'] }}
3950
- run: npm install
4051
- run: npm test

test/support/db/seed/schema.sql

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
/* Copyright (c) 2012 Mircea Alexandru */
2-
/* execute using mysql -u root < dbschema.sql */
3-
4-
DROP DATABASE IF EXISTS senecatest;
5-
CREATE DATABASE senecatest;
6-
7-
USE senecatest;
8-
91
CREATE TABLE foo (
102
id VARCHAR(36),
113
p1 VARCHAR(255),

0 commit comments

Comments
 (0)