This repository has been archived by the owner on Aug 6, 2024. It is now read-only.
generated from abir-taheer/quicker-picker-upper
-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (51 loc) · 1.98 KB
/
nodejs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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