Skip to content

Commit

Permalink
Merge pull request #83 from trilom/master-rebase
Browse files Browse the repository at this point in the history
Master rebase
  • Loading branch information
trilom authored Mar 19, 2020
2 parents 6ac7697 + 4873bc0 commit 4ee1a1a
Show file tree
Hide file tree
Showing 73 changed files with 6,603 additions and 12,587 deletions.
47 changes: 47 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
codecov:
require_ci_to_pass: yes

coverage:
status:
src:
target: auto
threshold: 7%
base: auto
if_ci_failed: success
paths:
- src/
- '!src/tests/'
flags:
- src
test:
target: 60%
threshold: 10%
if_ci_failed: error
base: auto
paths:
- src/tests/
flags:
- test
precision: 2
round: down
range: "70...100"
flags:
src:
paths:
- src
- '!src/tests/'
test:
paths:
- src/tests/
parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

83 changes: 0 additions & 83 deletions .eslintrc.json

This file was deleted.

71 changes: 71 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
plugins:
- '@typescript-eslint'
- eslint-comments
- promise
- unicorn
extends:
- airbnb-typescript
- plugin:@typescript-eslint/recommended
- plugin:eslint-comments/recommended
- plugin:promise/recommended
- plugin:unicorn/recommended
- prettier
- prettier/@typescript-eslint
settings:
import/parsers:
'@typescript-eslint/parser':
- .ts
- .tsx
- .js
import/resolver:
typescript: {}
rules:
unicorn/filename-case: off
react/static-property-placement: 0
no-prototype-builtins: 0
import/prefer-default-export: 0
'@typescript-eslint/no-explicit-any': 0
import/no-default-export: error
no-use-before-define:
- error
-
functions: false
classes: true
variables: true
'@typescript-eslint/explicit-function-return-type':
- error
-
allowExpressions: true
allowTypedFunctionExpressions: true
'@typescript-eslint/no-use-before-define':
- error
-
functions: false
classes: true
variables: true
typedefs: true
'@typescript-eslint/indent':
- 2
- 2
unicorn/prevent-abbreviations: 0
import/no-extraneous-dependencies: [error, {devDependencies: ['**/*.ts']}]
parser: "@typescript-eslint/parser"
parserOptions:
project: ./tsconfig.json
ecmaVersion: 2019
sourceType: module
env:
node: true
browser: true
overrides:
- files: ['src/tests/**/*']
plugins:
- jest
extends:
- plugin:jest/recommended
rules:
global-require: 0
'@typescript-eslint/no-var-requires': 0
no-console: 0
'@typescript-eslint/no-unused-vars': 0
'@typescript-eslint/no-throw-literal': 0
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
matrix:
event_type: ['push', 'pull_request']
build: ['true', 'false']
output: ['json', ',', ' ', '_<br />&nbsp;&nbsp;_']
fileOutput: ['json', ',', ' ', '_<br />&nbsp;&nbsp;_']
output: ['json', ',', ''' ''', '_<br />&nbsp;&nbsp;_']
fileOutput: ['json', ',', ''' ''', '_<br />&nbsp;&nbsp;_']
# event_type: ['pull_request']
# build: ['true']
# output: ['json']
Expand All @@ -34,7 +34,7 @@ jobs:
echo '${{toJSON(steps)}}'
- uses: actions/checkout@v2
if: matrix.build
- run: make run
- run: yarn build
if: matrix.build
- uses: ./
id: file_changes_build_pr
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make run
- run: yarn build
- uses: actions/github-script@0.6.0
if: failure() && contains(env.isFork, 'false')
with:
Expand All @@ -41,8 +41,10 @@ jobs:
needs: build
steps:
- uses: actions/checkout@v2
- run: make run
- run: make run COMMAND=test
- run: yarn build
- run: yarn test-coverage
- run: bash <(curl -s https://codecov.io/bash)
if: contains(env.isFork, 'false')
- uses: actions/github-script@0.6.0
if: failure() && contains(env.isFork, 'false')
with:
Expand All @@ -69,12 +71,13 @@ jobs:
if: github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v2
- run: yarn build
- name: Lint and report
uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check
eslint_flags: 'src/**/*.ts'
eslint_flags: '--ext .ts ./'
# lint code and comment back if possible
lintdog:
name: eslintdog (reviewdog)
Expand All @@ -83,12 +86,13 @@ jobs:
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v2
- run: yarn build
- name: Lint and report
uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.TRILOM_BOT_TOKEN }}
reporter: github-pr-review
eslint_flags: 'src/**/*.ts'
eslint_flags: '--ext .ts ./'
- uses: actions/github-script@0.6.0
if: failure()
with:
Expand Down Expand Up @@ -125,15 +129,15 @@ jobs:
token: ${{ secrets.TRILOM_BOT_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- run: make run
- run: make run COMMAND=format-check
- name: make run COMMAND=format and push code if check failed
- run: yarn build
- run: yarn format-check
- name: yarn format and push code if check failed
if: failure() && github.actor != 'trilom-bot' && contains(env.isFork, 'false')
env:
GITHUB_TOKEN: ${{ secrets.TRILOM_BOT_TOKEN }}
run: |
make run COMMAND=format
sudo make clean
yarn format
sudo yarn clean
git config --local user.email "trilom-bot@trailmix.me"
git config --local user.name "trilom-bot"
git add -A
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,19 @@ jobs:
run: |
git config --local user.email "trilom-bot@trailmix.me"
git config --local user.name "trilom-bot"
make run
make run COMMAND=release-pack
git add -A
git diff-index --quiet HEAD || git commit -m "Adding release changes ⚙️" -a
make run COMMAND=format
yarn build
yarn format
git add -A
git diff-index --quiet HEAD || git commit -m "Adding format changes 🤖" -a
yarn build-release
git add -A
git diff-index --quiet HEAD || git commit -m "Adding release changes ⚙️" -a
git log --format='%aN <%aE>%n%cN <%cE>' | sort -u > AUTHORS
sed -i '/trilom-bot/d' AUTHORS
sed -i '/semantic-release-bot/d' AUTHORS
sed -i '/carnoco@gmail.com/d' AUTHORS
sed -i '/GitHub <noreply@github.com>/d' AUTHORS
sed -i '/dependabot[bot]/d' AUTHORS
echo -e "\r\n$(date)" >> AUTHORS
git add -A
git diff-index --quiet HEAD || git commit -m "Updating AUTHORS 📓" -a
Expand Down Expand Up @@ -263,15 +268,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make run
- run: yarn build
# test with jest
test:
name: jest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make run
- run: make run COMMAND=test
- run: yarn build
- run: yarn test-coverage
- run: bash <(curl -s https://codecov.io/bash)
# lint code and comment back if possible
lintdog:
name: eslintdog (reviewdog)
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@

- When any `opened`, `reopened`, or `synchronize` **Pull Request** type runs(**pr.yml**):
- Assign it to trilom (**add-reviews**)
- Build code with `make run` which runs `yarn` and `tsc` (**build**)
- Build code with `yarn build` which runs `yarn` and `tsc` (**build**)
- Label with builds if passing and on inner workspace
- Test code with `make run COMMAND=test` which runs `jest` (**test**)
- Test code with `yarn test-coverage` which runs `jest` (**test**)
- Label with tested if passing and on inner workspace
- Test code with eslint reviewdog and report back if inner workspace (**lintdog**)
- Label with pretty if passing and on inner workspace
- Check format of code with `make run COMMAND=format-check` which runs `prettier --check` (**format_check_push**)
- Check format of code with `yarn format-check` which runs `prettier --check` (**format_check_push**)
- If:
- Fork then pull **Pull Request** github.ref with GITHUB_TOKEN
- Inner **Pull Request** then pull HEAD repo ref
- Build code with `make run` which runs `yarn` and `tsc`
- Build code with `yarn build` which runs `yarn` and `tsc`
- If format-check succeeds and on inner workspace
- Label with pretty
- If format-check fails and on inner workspace and actor is not trilom-bot
- Run `make run COMMAND=format` which runs `prettier --write`
- Clean build files with `make clean`
- Run `yarn format` which runs `prettier --write`
- Clean build files with `yarn clean`
- Commit the format changes as trilom-bot to **Pull Request** head

## Push

- When any **Push** type runs to _master_, _next_, _alpha_, or _beta_(**push.yml**):
- Build code with `make run` which runs `yarn` and `tsc` (**build**)
- Test code with `make run COMMAND=test` which runs `jest` (**test**)
- Build code with `yarn build` which runs `yarn` and `tsc` (**build**)
- Test code with `yarn test-coverage` which runs `jest` (**test**)
- Test code with eslint reviewdog and report back with github checks(**lintdog**)
- When any **Push** type runs to _master_, _next_, _alpha_, or _beta_ with a head_commit message **NOT** containing 'trilom/v1.' or 'trilom/v2.':
- Build **dist/\*\*.js** files, update **AUTHORS**, format **src/\*\*.ts** files and commit.
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ build/Release
# Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/
# # TypeScript v1 declaration files
# typings/

# TypeScript cache
*.tsbuildinfo
Expand Down
Loading

0 comments on commit 4ee1a1a

Please sign in to comment.