Skip to content

Commit

Permalink
Merge pull request #35 from technote-space/release/v1.1.0
Browse files Browse the repository at this point in the history
Release/v1.1.0
  • Loading branch information
technote-space authored Sep 15, 2019
2 parents 2cef19b + f572c9a commit dc7dfac
Show file tree
Hide file tree
Showing 18 changed files with 1,159 additions and 420 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4

[{*.json,*.yml}]
indent_style = space
indent_size = 2
149 changes: 149 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"plugins": [
"@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018
},
"env": {
"node": true,
"jest": true,
"es6": true,
"browser": true
},
"settings": {
"react": {
"version": "latest"
}
},
"rules": {
"camelcase": [
"error",
{
"properties": "always"
}
],
"require-jsdoc": [
"error",
{
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true
}
}
],
"valid-jsdoc": [
"error",
{
"requireReturn": false,
"preferType": {
"String": "string",
"Object": "object",
"Number": "number",
"Function": "function",
"Void": "void"
}
}
],
"quotes": [
"error",
"single",
"avoid-escape"
],
"key-spacing": [
"error",
{
"singleLine": {
"beforeColon": false,
"afterColon": true
},
"multiLine": {
"beforeColon": false,
"afterColon": true
}
}
],
"no-magic-numbers": [
"error",
{
"ignoreArrayIndexes": true
}
],
"eqeqeq": "error",
"block-scoped-var": "error",
"complexity": [
"error",
{
"maximum": 20
}
],
"curly": "error",
"default-case": "error",
"dot-location": [
"error",
"property"
],
"guard-for-in": "error",
"no-eval": "error",
"block-spacing": "error",
"brace-style": "error",
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"id-length": [
"error",
{
"min": 2,
"properties": "never",
"exceptions": [
"$"
]
}
],
"indent": [
"error",
"tab",
{
"MemberExpression": "off"
}
],
"space-before-function-paren": [
"error",
"never"
],
"space-before-blocks": "error",
"prefer-const": "error",
"no-var": "error",
"arrow-body-style": "off",
"arrow-spacing": "error",
"strict": [
"error"
],
"no-warning-comments": [
"warn",
{
"terms": [
"todo",
"fixme",
"hack"
],
"location": "anywhere"
}
],
"semi": [
"error"
]
}
}
4 changes: 3 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[issues]: https://github.com/technote-space/assign-author/issues
[fork]: https://github.com/technote-space/assign-author/fork
[pr]: https://github.com/technote-space/assign-author/compare
[eslint]: https://eslint.org/
[jest]: https://jestjs.io/
[code-of-conduct]: CODE_OF_CONDUCT.md

Expand All @@ -12,7 +13,8 @@ Please note we have a [Contributor Code of Conduct][code-of-conduct], please fol
## Submitting a pull request

1. [Fork][fork] and clone the repository
1. Make sure the tests pass on your machine: `composer test`, which contains
1. Make sure the tests pass on your machine: `yarn test`, which contains
- [`ESLint`][eslint]
- [`Jest`][jest]
1. Create a new branch: `git checkout -b my-branch-name`
1. Make your change, add tests, and make sure the tests still pass.
Expand Down
59 changes: 49 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,75 @@ on:
name: Build

jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 3
- name: Install Package dependencies
run: yarn install
- name: Check code style
run: yarn lint
- uses: 8398a7/action-slack@v1
with:
type: failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure()

jest:
name: Jest
runs-on: ubuntu-latest
strategy:
matrix:
node: ['8', '10', '11', '12']
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
fetch-depth: 3
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install Package dependencies
run: yarn install
- name: Run tests
run: yarn cover
- name: Send covarage
run: yarn add coveralls && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_SERVICE_NAME: "GitHub Action"
COVERALLS_SERVICE_JOB_ID: ${{ github.sha }}
COVERALLS_GIT_COMMIT: ${{ github.sha }}
COVERALLS_GIT_BRANCH: ${{ github.ref }}
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel: true
- uses: 8398a7/action-slack@v1
with:
type: failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure()

coverallsFinished:
name: Coveralls Finished
needs: jest
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true

slack:
name: Slack
needs: coverallsFinished
runs-on: ubuntu-latest
steps:
- uses: 8398a7/action-slack@v1
with:
type: success
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: success()
4 changes: 4 additions & 0 deletions __tests__/fixtures/repos.issues.assignees.403.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"message": "Resource not accessible by integration",
"documentation_url": "https://developer.github.com/v3"
}
73 changes: 37 additions & 36 deletions __tests__/util.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
const fs = require('fs');
const path = require('path');

export const getContext = (override: object) => Object.assign({
payload: {
action: '',
},
eventName: '',
sha: '',
ref: '',
workflow: '',
action: '',
actor: '',
issue: {
owner: '',
repo: '',
number: 1,
},
repo: {
owner: '',
repo: '',
},
}, override);

export const getApiFixture = (name: string) => JSON.parse(fs.readFileSync(path.resolve(__dirname, `./fixtures/${name}.json`)));

export const disableNetConnect = nock => {
beforeEach(() => {
nock.disableNetConnect();
});

afterEach(() => {
nock.cleanAll();
nock.enableNetConnect();
});
};
import { Context } from '@actions/github/lib/context';
import * as fs from 'fs';
import * as path from 'path';

export const getContext = (override: object): Context => Object.assign({
payload: {
action: '',
},
eventName: '',
sha: '',
ref: '',
workflow: '',
action: '',
actor: '',
issue: {
owner: '',
repo: '',
number: 1,
},
repo: {
owner: '',
repo: '',
},
}, override);

export const getApiFixture = (name: string): object => JSON.parse(fs.readFileSync(path.resolve(__dirname, `./fixtures/${name}.json`)).toString());

export const disableNetConnect = (nock): void => {
beforeEach(() => {
nock.disableNetConnect();
});

afterEach(() => {
nock.cleanAll();
nock.enableNetConnect();
});
};
Loading

0 comments on commit dc7dfac

Please sign in to comment.