-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
81 additions
and
20 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,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" |
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,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(); | ||
}; |