Skip to content

Commit

Permalink
Merge pull request #23 from snyk/chore/update-cci-config
Browse files Browse the repository at this point in the history
chore/update cci config
  • Loading branch information
ivanstanev committed Mar 27, 2020
2 parents 39bdde0 + 1c61e23 commit a84603e
Show file tree
Hide file tree
Showing 7 changed files with 830 additions and 115 deletions.
47 changes: 34 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,9 @@ version: 2.1
defaults: &defaults
resource_class: small
docker:
- image: gcr.io/snyk-main/nsolid-ubuntu:erbium
auth:
username: _json_key
password: $GCLOUD_GCR_BUILDER
- image: node:12
working_directory: ~/rpm-parser

private_cicd_repo_auth: &private_cicd_repo_auth
auth:
username: _json_key
password: $GCLOUD_GCR_BUILDER

commands:
install_deps:
description: Install dependencies
Expand Down Expand Up @@ -51,11 +43,18 @@ jobs:
steps:
- install_deps

lint:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/rpm-parser
- run:
name: Lint
command: npm run lint

test:
<<: *defaults
docker:
- image: gcr.io/snyk-main/nsolid-ubuntu:erbium
<<: *private_cicd_repo_auth
steps:
- checkout
- attach_workspace:
Expand All @@ -70,7 +69,7 @@ jobs:
- checkout
- run:
name: Release on GitHub
command: npx semantic-release
command: exit 1 # npx semantic-release

workflows:
version: 2
Expand All @@ -84,6 +83,16 @@ workflows:
branches:
ignore:
- master

- lint:
name: Lint
context: nodejs-install
requires:
- Install with devDependencies
filters:
branches:
ignore:
- master
- test:
name: Test
context: nodejs-install
Expand All @@ -98,6 +107,7 @@ workflows:
context: nodejs-install
requires:
- Test
- Lint
filters:
branches:
ignore:
Expand All @@ -112,6 +122,15 @@ workflows:
branches:
only:
- master
- lint:
name: Lint
context: nodejs-install
requires:
- Install with devDependencies
filters:
branches:
only:
- master
- test:
name: Test
context: nodejs-install
Expand All @@ -126,6 +145,7 @@ workflows:
context: nodejs-install
requires:
- Test
- Lint
filters:
branches:
only:
Expand All @@ -136,6 +156,7 @@ workflows:
requires:
- Install with devDependencies
- Test
- Lint
- Install PROD deps
filters:
branches:
Expand Down
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"extraFileExtensions": [".ts"]
},
"plugins": ["@typescript-eslint"],
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"rules": {
"@typescript-eslint/semi": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/unbound-method": "error"
}
}
2 changes: 1 addition & 1 deletion lib/berkeleydb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function validateBerkeleyDbMetadata(data: Buffer): void | never {
/**
* Exported for testing
*/
export function validatePageSize(pageSize: number) {
export function validatePageSize(pageSize: number): void | never {
if (!validPageSizes.includes(pageSize)) {
throw new Error(`Invalid page size: ${pageSize}`);
}
Expand Down

0 comments on commit a84603e

Please sign in to comment.