Skip to content

Commit

Permalink
Merge 78f719a into 021d509
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriaan committed Mar 20, 2021
2 parents 021d509 + 78f719a commit 2915ca9
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 20 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Node CI Main

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/setup-node@v2
with:
node-version: "14"

- uses: actions/checkout@v2
if: github.event_name == 'pull_request'
with:
ref: ${{ github.head_ref }}

- uses: actions/checkout@v2
if: github.ref == 'refs/heads/master'

- name: Prettier Action on PR
if: github.event_name == 'pull_request'
uses: creyD/prettier_action@v3.0
with:
prettier_version: ^2.1.1
commit_message: "Run prettier via GitHub Action"
file_pattern: "."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Prettier Action on main
if: github.ref == 'refs/heads/main'
uses: creyD/prettier_action@v3.0
with:
prettier_version: ^2.1.1
commit_message: "Run prettier via GitHub Action"
file_pattern: "."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: harmon758/postgresql-action@v1
with:
postgresql version: "12"
postgresql user: "user"
postgresql password: "password"

- name: npm install, and test
run: |
npm install
npm test
env:
CI: true
NODE_ENV: test
PG_CONNECTION_STRING: "postgresql://user:password@localhost"
40 changes: 20 additions & 20 deletions lib/build-yargs.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
module.exports = function () {
return require('yargs')
.usage('$0 [options] <dbname>')
.option('host', {
alias: 'h',
default: '127.0.0.1',
describe: 'database server host or socket directory'
return require("yargs")
.usage("$0 [options] <dbname>")
.option("host", {
alias: "h",
default: "127.0.0.1",
describe: "database server host or socket directory",
})
.option('port', {
alias: 'p',
.option("port", {
alias: "p",
default: 5432,
describe: 'database server port'
describe: "database server port",
})
.option('user', {
alias: 'u',
default: 'postgres',
describe: 'user name to connect as'
.option("user", {
alias: "u",
default: "postgres",
describe: "user name to connect as",
})
.option('password', {
describe: 'password to use when connecting'
.option("password", {
describe: "password to use when connecting",
})
.option('silent', {
.option("silent", {
default: false,
describe: 'should we output to stdout'
describe: "should we output to stdout",
})
.demand(1, 'you must provide a database name')
.demand(1, "you must provide a database name")
.help()
.version()
}
.version();
};

0 comments on commit 2915ca9

Please sign in to comment.