-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Add Actions CI * Run Actions CI in addition to Travis * Make database user name for tests dynamic In order to that, I replaced config.json with config.js. If `DATABASE_USER_TEST` is set in the environment, it is used, otherwise we default to the user running the process, which is the default for MacOS setups. * Make test its own step Instead of doing, install, build and test in one step, I prefer having a dedicated test step. * Try building multiple node versions This should help us detect issues with the next node version early on.
- Loading branch information
Dennis Sivia
authored
Aug 21, 2019
1 parent
32db8ec
commit d615bb7
Showing
5 changed files
with
73 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: GitHub CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [10.x, 12.x] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
env: | ||
NODE_ENV: test | ||
- name: npm install, build | ||
env: | ||
NODE_ENV: test | ||
DB_USERNAME_TEST: "postgres" | ||
run: | | ||
npm install | ||
./node_modules/.bin/sequelize db:create --env test | ||
./node_modules/.bin/sequelize db:migrate --env test | ||
- name: npm test | ||
env: | ||
NODE_ENV: test | ||
DB_USERNAME_TEST: "postgres" | ||
run: | | ||
npm test | ||
services: | ||
postgresql: | ||
image: postgres | ||
ports: | ||
- 5432:5432 | ||
redis: | ||
image: redis | ||
ports: | ||
- 6379:6379 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
"config": path.resolve('./db/config.json'), | ||
"models-path": path.resolve('./lib/models'), | ||
"seeders-path": path.resolve('./db/seeders'), | ||
"migrations-path": path.resolve('./db/migrations') | ||
"config": path.resolve('db', 'config.js'), | ||
"models-path": path.resolve('db', 'models'), | ||
"seeders-path": path.resolve('db', 'seeders'), | ||
"migrations-path": path.resolve('db', 'migrations') | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require('dotenv').config(); | ||
const os = require('os'); | ||
|
||
module.exports = { | ||
development: { | ||
database: 'slack-dev', | ||
host: '127.0.0.1', | ||
dialect: 'postgres', | ||
operatorsAliases: false, | ||
}, | ||
test: { | ||
database: 'slack-test', | ||
host: '127.0.0.1', | ||
dialect: 'postgres', | ||
operatorsAliases: false, | ||
username: process.env.DB_USERNAME_TEST || os.userInfo().username, | ||
}, | ||
production: { | ||
use_env_variable: 'DATABASE_URL', | ||
disable_sql_logging: true, | ||
operatorsAliases: false, | ||
ssl: true, | ||
dialectOptions: { | ||
ssl: true, | ||
}, | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
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