loopback-connector-mysql/.github/workflows/continuous-integration.yaml

66 lines
1.9 KiB
YAML
Raw Normal View History

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [10, 12, 14, 15]
# services:
# mysql:
# image: mysql:5.7
# env:
# MYSQL_USER: user
# MYSQL_PASSWORD: pass
# MYSQL_ALLOW_EMPTY_PASSWORD: yes
# MYSQL_DATABASE: 'testdb'
# MYSQL_ROOT_PASSWORD: root
# MYSQL_HOST: localhost
# ports:
# - 3306:3306
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Set up MySQL 5.7
uses: mirromutth/mysql-action@master
with:
host port: 3000
mysql version: 5.7
mysql database: testdb
mysql root password: root
- name: Wait for MySQL
run: |
sudo systemctl start mysql
docker ps -a
docker run -it -e MYSQL_ROOT_PASSWORD=root -v /var/run/mysqld:/host/mysqld -d mysql:5.7
while ! mysqladmin ping --host=127.0.0.1 --port 3000 --password=$MYSQL_ROOT_PASSWORD --silent < ./test/schema.sql; do
sleep 1
done
docker container ls
mysql -uroot -proot "SHOW DATABASES;"
- name: npm install, build, and test
run: |
npm install
npm test
env:
DB_PORT: 3306
CI: true
# docker run -it -e MYSQL_ROOT_PASSWORD=root -v /var/run/mysqld/mysqld.sock:/host/mysqld/mysqld.sock -d mysql:5.7