44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
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.22
|
|
env:
|
|
MYSQL_USER: user
|
|
MYSQL_PASSWORD: pass
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
|
MYSQL_DATABASE: 'testdb'
|
|
MYSQL_ROOT_PASSWORD: root
|
|
|
|
steps:
|
|
- name: Set Up MySQL
|
|
run: sudo /etc/init.d/mysql start
|
|
|
|
- uses: actions/checkout@v2
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Create DB and User
|
|
run: |
|
|
mysql -uroot -proot -e 'CREATE DATABASE testdb;'
|
|
mysql -uroot -proot -e "CREATE USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pass';"
|
|
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost';"
|
|
mysql -uroot -proot -e "FLUSH PRIVILEGES"
|
|
- run: npm install
|
|
- run: npm test
|