-
Notifications
You must be signed in to change notification settings - Fork 14
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
1 parent
d923b94
commit a2ec33a
Showing
25 changed files
with
8,865 additions
and
0 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,85 @@ | ||
version: 2 | ||
|
||
aliases: | ||
- &restore-cache | ||
restore_cache: | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
- &install-deps | ||
run: | ||
name: Install dependencies | ||
command: yarn install --frozen-lockfile | ||
- &build-packages | ||
run: | ||
name: Build | ||
command: yarn build | ||
|
||
jobs: | ||
build: | ||
working_directory: ~/nestjs-google-pubsub-microservice | ||
docker: | ||
- image: circleci/node:12 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Update NPM version | ||
command: 'sudo npm install -g npm@latest' | ||
- *restore-cache | ||
- *install-deps | ||
- save_cache: | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
paths: | ||
- ./node_modules | ||
- *build-packages | ||
- run: | ||
name: Unit tests | ||
command: yarn test | ||
|
||
integration_tests: | ||
working_directory: ~/nestjs-google-pubsub-microservice | ||
machine: true | ||
environment: | ||
PUBSUB_EMULATOR_HOST: localhost:8681 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Prepare nvm | ||
command: | | ||
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV | ||
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV | ||
- run: | ||
name: Upgrade Node.js | ||
command: | | ||
nvm install v12 | ||
node -v | ||
nvm alias default v12 | ||
- run: | ||
name: Install Yarn | ||
command: npm install yarn -g | ||
- run: | ||
name: Install Docker Compose | ||
command: | | ||
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > ~/docker-compose | ||
chmod +x ~/docker-compose | ||
sudo mv ~/docker-compose /usr/local/bin/docker-compose | ||
- *restore-cache | ||
- *install-deps | ||
- run: | ||
name: Prepare | ||
command: | | ||
docker-compose up -d | ||
sleep 10 | ||
- run: | ||
name: List containers | ||
command: docker ps | ||
- run: | ||
name: e2e tests | ||
command: yarn test:e2e | ||
|
||
workflows: | ||
version: 2 | ||
build-and-test: | ||
jobs: | ||
- build | ||
- integration_tests: | ||
requires: | ||
- build |
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,28 @@ | ||
{ | ||
"extends": ["@commitlint/config-angular"], | ||
"rules": { | ||
"subject-case": [ | ||
2, | ||
"always", | ||
["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"] | ||
], | ||
"type-enum": [ | ||
2, | ||
"always", | ||
[ | ||
"build", | ||
"chore", | ||
"ci", | ||
"docs", | ||
"feat", | ||
"fix", | ||
"perf", | ||
"refactor", | ||
"revert", | ||
"style", | ||
"test", | ||
"sample" | ||
] | ||
] | ||
} | ||
} |
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 @@ | ||
tests/** |
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,26 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint/eslint-plugin'], | ||
extends: [ | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier', | ||
'prettier/@typescript-eslint', | ||
], | ||
root: true, | ||
env: { | ||
node: true, | ||
jest: true, | ||
}, | ||
rules: { | ||
'@typescript-eslint/interface-name-prefix': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
}, | ||
}; |
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,14 @@ | ||
# source | ||
lib | ||
tests | ||
index.ts | ||
yarn-lock.json | ||
tslint.json | ||
tsconfig.json | ||
.prettierrc | ||
.idea | ||
|
||
# github | ||
.github | ||
CONTRIBUTING.md | ||
renovate.json |
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,4 @@ | ||
{ | ||
"trailingComma": "all", | ||
"singleQuote": true | ||
} |
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,8 @@ | ||
{ | ||
"git": { | ||
"commitMessage": "chore(): release v${version}" | ||
}, | ||
"github": { | ||
"release": true | ||
} | ||
} |
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,7 @@ | ||
version: "3" | ||
services: | ||
pubsub: | ||
image: messagebird/gcloud-pubsub-emulator:latest | ||
ports: | ||
- '8681:8681' | ||
restart: always |
Oops, something went wrong.