Skip to content

Commit

Permalink
add: initial semaphore pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
maxchehab committed Jun 13, 2019
1 parent ea4ecf1 commit 12260ee
Show file tree
Hide file tree
Showing 8 changed files with 3,884 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
yarn-error.log
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
96 changes: 96 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
version: v1.0
name: workos-node pipeline

execution_time_limit:
minutes: 15

agent:
machine:
type: e1-standard-2
os_image: ubuntu1804

blocks:
- name: Install dependencies
task:
env_vars:
- name: NODE_ENV
value: test
- name: CI
value: "true"
prologue:
commands:
- checkout
- nvm use
- node --version
- npm --version
jobs:
- name: yarn install and cache
commands:
- cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
- yarn bootstrap
- cache store client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock) node_modules

- name: Lint
task:
env_vars:
- name: NODE_ENV
value: test
- name: CI
value: "true"
prologue:
commands:
- checkout
- nvm use
- node --version
- npm --version
jobs:
- name: Run lint
commands:
- cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
- yarn lint

- name: Formatting
task:
env_vars:
- name: NODE_ENV
value: test
- name: CI
value: "true"
prologue:
commands:
- checkout
- nvm use
- node --version
- npm --version
jobs:
- name: Run prettier
commands:
- cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
- yarn prettier

- name: Tests
task:
prologue:
commands:
- checkout
- nvm use
- node --version
- nvm --version
- name: Run tests
commands:
- cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
- yarn test

- name: Build
task:
prologue:
commands:
- checkout
- nvm use
- node --version
- npm --version
jobs:
- name: Run build
commands:
- cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
- yarn build
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "workos-node",
"private": true,
"scripts": {
"build": "tsc -p tsconfig.json",
"lint": "tslint -p tsconfig.json -c tslint.json",
"test": "jest --passWithNoTests",
"prettier": "prettier \"src/**/*.{js,ts,tsx}\" --check",
"format": "prettier \"src/**/*.{js,ts,tsx}\" --write"
},
"devDependencies": {
"jest": "24.8.0",
"prettier": "1.18.2",
"supertest": "4.0.2",
"ts-jest": "24.0.2",
"typescript": "3.5.1"
}
}
25 changes: 25 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"allowJs": false,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "preserve",
"lib": ["dom", "es2017"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext",
"typeRoots": ["./node_modules/@types"]
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["**/*.spec.{ts,tsx}", "dist"]
}
21 changes: 21 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"defaultSeverity": "error",
"extends": ["tslint:recommended"],
"jsRules": {
"no-unused-expression": true
},
"rules": {
"arrow-parens": false,
"interface-name": [false],
"max-line-length": [true, 150],
"member-access": [false],
"member-ordering": [false],
"object-literal-sort-keys": false,
"ordered-imports": [false],
"quotemark": [true, "single", "jsx-double"],
"variable-name": [true, "allow-leading-underscore"],
"semicolon": [true, "always", "ignore-bound-class-methods"],
"no-default-export": true
},
"rulesDirectory": []
}
Loading

0 comments on commit 12260ee

Please sign in to comment.