-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert build to use github actions (#78)
* Move PR template into .github directory * first pass at github actions for test runs and npm publish * update node version to current LTS * update .npmignore file * bump dependencies * trying docker setup * workflow updates and deps upgrades including eslint * no need for eslintrc * warn only on outdated deps * no more drone * minor tweaks to publish workflow * removing docker deploy from postversion script --------- Co-authored-by: Rajesh Susai <raj.susai@meltwater.com>
- Loading branch information
1 parent
c150cbb
commit 3a532ed
Showing
14 changed files
with
989 additions
and
921 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,113 +1,113 @@ | ||
{ | ||
// http://eslint.org/docs/rules/ | ||
"env": { | ||
"jasmine": true, | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module" | ||
}, | ||
|
||
"extends": "eslint:recommended", | ||
"rules": { | ||
"valid-jsdoc": "error", | ||
"default-case": "error", | ||
"id-length": [ | ||
"error", | ||
{ | ||
"min": 2, | ||
"exceptions": ["id"] | ||
} | ||
], | ||
"no-alert": "error", | ||
"no-implicit-coercion": "error", | ||
"no-implied-eval": "error", | ||
"no-invalid-this": "error", | ||
"no-labels": "error", | ||
"no-lone-blocks": "error", | ||
"no-loop-func": "error", | ||
"no-magic-numbers": [ | ||
"error", | ||
{ | ||
"ignore": [0, 1, 2] | ||
} | ||
], | ||
"no-param-reassign": "error", | ||
"no-prototype-builtins": "off", | ||
"no-return-assign": ["error", "always"], | ||
"no-script-url": "error", | ||
"no-self-compare": "error", | ||
"no-sequences": "error", | ||
"no-throw-literal": "error", | ||
"no-unmodified-loop-condition": "error", | ||
"no-unused-expressions": "error", | ||
"no-useless-call": "error", | ||
"no-useless-concat": "error", | ||
"no-useless-return": "error", | ||
"no-void": "error", | ||
"no-with": "error", | ||
|
||
/** | ||
* Stylistic rules | ||
*/ | ||
|
||
"camelcase": "error", | ||
"complexity": "error", | ||
"curly": [ | ||
"error", | ||
"all" | ||
], | ||
"max-depth": [ | ||
"error", | ||
3 // http://eslint.org/docs/rules/max-depth | ||
], | ||
"new-cap": "error", | ||
"new-parens": "error", | ||
"no-continue": "error", | ||
"no-lonely-if": "error", | ||
"no-multiple-empty-lines": [ | ||
// http://eslint.org/docs/rules/ | ||
"env": { | ||
"jasmine": true, | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module" | ||
}, | ||
|
||
"extends": "eslint:recommended", | ||
"rules": { | ||
"valid-jsdoc": "error", | ||
"default-case": "error", | ||
"id-length": [ | ||
"error", | ||
{ | ||
"max": 1 | ||
"min": 2, | ||
"exceptions": ["id"] | ||
} | ||
], | ||
"no-nested-ternary": "error", | ||
"no-tabs": "error", | ||
"no-trailing-spaces": [ | ||
"error", | ||
{ | ||
"ignoreComments": true, | ||
"skipBlankLines": true | ||
} | ||
], | ||
"no-unneeded-ternary": "error", | ||
"nonblock-statement-body-position": [ | ||
"error", | ||
"beside" // http://eslint.org/docs/rules/nonblock-statement-body-position | ||
], | ||
"one-var-declaration-per-line": [ | ||
"error", | ||
"always" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"vars-on-top": "error", | ||
|
||
/** | ||
* ES6 Specific | ||
], | ||
"no-alert": "error", | ||
"no-implicit-coercion": "error", | ||
"no-implied-eval": "error", | ||
"no-invalid-this": "error", | ||
"no-labels": "error", | ||
"no-lone-blocks": "error", | ||
"no-loop-func": "error", | ||
"no-magic-numbers": [ | ||
"error", | ||
{ | ||
"ignore": [0, 1, 2] | ||
} | ||
], | ||
"no-param-reassign": "error", | ||
"no-prototype-builtins": "off", | ||
"no-return-assign": ["error", "always"], | ||
"no-script-url": "error", | ||
"no-self-compare": "error", | ||
"no-sequences": "error", | ||
"no-throw-literal": "error", | ||
"no-unmodified-loop-condition": "error", | ||
"no-unused-expressions": "error", | ||
"no-useless-call": "error", | ||
"no-useless-concat": "error", | ||
"no-useless-return": "error", | ||
"no-void": "error", | ||
"no-with": "error", | ||
|
||
/** | ||
* Stylistic rules | ||
*/ | ||
|
||
"arrow-body-style": [ | ||
"error", | ||
"as-needed" | ||
], | ||
"no-confusing-arrow": "error", | ||
"no-useless-constructor": "error", | ||
"no-var": "error", | ||
"prefer-const": "error", | ||
"prefer-template": "error" | ||
} | ||
} | ||
|
||
"camelcase": "error", | ||
"complexity": "error", | ||
"curly": [ | ||
"error", | ||
"all" | ||
], | ||
"max-depth": [ | ||
"error", | ||
3 // http://eslint.org/docs/rules/max-depth | ||
], | ||
"new-cap": "error", | ||
"new-parens": "error", | ||
"no-continue": "error", | ||
"no-lonely-if": "error", | ||
"no-multiple-empty-lines": [ | ||
"error", | ||
{ | ||
"max": 1 | ||
} | ||
], | ||
"no-nested-ternary": "error", | ||
"no-tabs": "error", | ||
"no-trailing-spaces": [ | ||
"error", | ||
{ | ||
"ignoreComments": true, | ||
"skipBlankLines": true | ||
} | ||
], | ||
"no-unneeded-ternary": "error", | ||
"nonblock-statement-body-position": [ | ||
"error", | ||
"beside" // http://eslint.org/docs/rules/nonblock-statement-body-position | ||
], | ||
"one-var-declaration-per-line": [ | ||
"error", | ||
"always" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"vars-on-top": "error", | ||
|
||
/** | ||
* ES6 Specific | ||
*/ | ||
|
||
"arrow-body-style": [ | ||
"error", | ||
"as-needed" | ||
], | ||
"no-confusing-arrow": "error", | ||
"no-useless-constructor": "error", | ||
"no-var": "error", | ||
"prefer-const": "error", | ||
"prefer-template": "error" | ||
} | ||
} |
File renamed without changes.
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,23 @@ | ||
name: Node.js CI test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x, 18.x, 20.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm test |
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,64 @@ | ||
name: NPM Pipeline | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Node.js CI test"] | ||
types: | ||
- completed | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
Publish: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: "npm" | ||
registry-url: https://registry.npmjs.org | ||
cache-dependency-path: package-lock.json | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Publish package | ||
run: npm publish | ||
|
||
- name: Build package | ||
run: scripts/build-packages | ||
|
||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: awsudo:${{github.ref_name}} | ||
path: awsudo-${{github.ref_name}}.tgz | ||
|
||
Deploy_Docker_Image: | ||
runs-on: ubuntu-latest | ||
needs: Publish | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
|
||
steps: | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: awsudo:${{github.ref_name}} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build Docker image | ||
run: scripts/deploy-docker |
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,6 +1,7 @@ | ||
docker/ | ||
scripts/ | ||
|
||
.github | ||
.drone.yml | ||
.editorconfig | ||
.eslintrc | ||
|
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 +1 @@ | ||
lts/fermium | ||
lts/iron |
Oops, something went wrong.