This repository has been archived by the owner on Aug 6, 2024. It is now read-only.
Merge pull request #750 from stuysu/addUser #1679
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js CI | |
on: [push] | |
jobs: | |
build-on-mysql: | |
runs-on: ${{ matrix.os }} | |
env: | |
SEQUELIZE_URL: mysql://root:password@localhost:3306/ci | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_DATABASE: ci | |
MYSQL_ROOT_PASSWORD: password | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 3306:3306 | |
strategy: | |
matrix: | |
node-version: [16.x] | |
os: [ubuntu-20.04] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache node modules | |
uses: actions/cache@v1 | |
env: | |
cache-name: cache-node-modules-mysql | |
with: | |
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS | |
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 | |
- name: Install database-specific packages | |
run: npm install mysql2 | |
- name: Build | |
run: npm run build | |
- name: Test undo # Sometimes db:migrate:undo breaks, but not build/db:migrate | |
run: node --require esm node_modules/.bin/sequelize-cli db:migrate:undo | |
- name: Undo the undo | |
run: node --require esm node_modules/.bin/sequelize-cli db:migrate | |
- name: Test | |
run: npm test |