This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from ACloudGuru/add-github-actions
Add GitHub actions
- Loading branch information
Showing
39 changed files
with
3,229 additions
and
1,505 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,2 @@ | ||
extends: | ||
- '@commitlint/config-conventional' |
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,38 @@ | ||
extends: | ||
- airbnb-base | ||
- prettier | ||
- plugin:import/errors | ||
- plugin:import/warnings | ||
- plugin:jest/recommended | ||
|
||
globals: | ||
Atomics: readonly | ||
SharedArrayBuffer: readonly | ||
|
||
parserOptions: | ||
ecmaVersion: 2020 | ||
sourceType: module | ||
|
||
plugins: | ||
- jest | ||
- prettier | ||
|
||
rules: { | ||
"prettier/prettier": "error", | ||
"import/prefer-default-export": 0, | ||
"jest/no-focused-tests": 0, | ||
|
||
# eventually want to remove everything below this | ||
"class-methods-use-this": 0, | ||
"prefer-object-spread": 0, | ||
"prefer-destructuring": 0, | ||
"no-return-assign": 0, | ||
"array-callback-return": 0, | ||
"global-require": 0, | ||
"consistent-return": 0, | ||
"no-param-reassign": 0, | ||
"no-underscore-dangle": 0, | ||
"no-plusplus": 0, | ||
"guard-for-in": 0, | ||
"no-restricted-syntax": 0 | ||
} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [10.x, 12.x, 14.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install packages | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Run lint | ||
run: yarn lint | ||
|
||
- name: Run tests | ||
run: yarn test | ||
|
||
- name: Generate code coverage | ||
uses: codecov/codecov-action@v1 |
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,29 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
publish: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use node 14.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install packages | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Publish to npm | ||
run: yarn release | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
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 @@ | ||
_ |
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 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn commitlint --edit. |
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,5 @@ | ||
{ | ||
"tabWidth": 2, | ||
"printWidth": 80, | ||
"singleQuote": true | ||
} |
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
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,15 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: auto | ||
threshold: null | ||
|
||
comment: | ||
layout: "reach, diff, flags, files" | ||
behavior: default | ||
require_changes: false | ||
require_base: no | ||
require_head: yes | ||
branches: | ||
- master |
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,3 @@ | ||
exports.handler = (event, context, cb) => { | ||
console.log('Received event', event); | ||
console.log('Blah'); | ||
|
||
exports.handler = (_, __, cb) => { | ||
cb(new Error('This is an error')); | ||
}; |
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
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,9 +1,5 @@ | ||
exports.handler = (event, context, cb) => { | ||
console.log('Received event', event); | ||
console.log('Sleeping'); | ||
|
||
exports.handler = (_, __, cb) => { | ||
setTimeout(() => { | ||
console.log('Awake'); | ||
cb(null, { message: 'success' }); | ||
}, 10000); | ||
} | ||
}; |
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 |
---|---|---|
|
@@ -7,31 +7,39 @@ | |
"lint": "eslint .", | ||
"lint-fix": "eslint . --fix", | ||
"test": "jest --coverage", | ||
"test:watch": "jest --watch" | ||
"test:watch": "jest --watch", | ||
"postinstall": "husky install", | ||
"prepublishOnly": "pinst --disable", | ||
"postpublish": "pinst --enable" | ||
}, | ||
"repository": { | ||
"url": "https://github.com/ACloudGuru/serverless-plugin-aws-alerts.git", | ||
"type": "git" | ||
}, | ||
"author": "John McKim <[email protected]>", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"serverless": "^2.4.0" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.10" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^2.11.16", | ||
"eslint": "^4.7.1", | ||
"eslint-config-standard": "^6.2.0", | ||
"eslint-plugin-node": "^4.0.0", | ||
"eslint-plugin-promise": "^3.4.1", | ||
"eslint-plugin-standard": "^2.0.1", | ||
"jest": "^19.0.2" | ||
"@commitlint/config-conventional": "^11.0.0", | ||
"commitlint": "^11.0.0", | ||
"eslint": "^7.19.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-config-prettier": "^7.2.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
"husky": "^5.0.9", | ||
"jest": "^19.0.2", | ||
"pinst": "^2.1.4", | ||
"prettier": "^2.2.1" | ||
}, | ||
"peerDependencies": { | ||
"serverless": "^2.4.0" | ||
}, | ||
"engines": { | ||
"node": ">=6.10.0" | ||
"node": ">=8.10.0" | ||
}, | ||
"jest": { | ||
"testMatch": [ | ||
|
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
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
Oops, something went wrong.