-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add some more configurations and dev tools
- Loading branch information
Showing
10 changed files
with
1,532 additions
and
40 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,13 @@ | ||
coverage: | ||
status: | ||
patch: | ||
default: | ||
target: 90% | ||
project: | ||
default: | ||
target: auto | ||
threshold: 2% | ||
comment: | ||
layout: diff, flags, files | ||
require_changes: true | ||
|
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,25 @@ | ||
{ | ||
"version": "0.1", | ||
"language": "en", | ||
"ignorePaths": [ | ||
"**/coverage/**", | ||
"**/node_modules/**", | ||
"**/dist/**", | ||
"**/*.{json,snap}", | ||
".cspell.json" | ||
], | ||
"dictionaries": [ | ||
"typescript", | ||
"softwareTerms", | ||
"node", | ||
"en_US", | ||
"npm", | ||
"misc", | ||
"filetypes" | ||
], | ||
"overrides": [ | ||
{ | ||
"filename": "**/*.{ts,js}", | ||
} | ||
] | ||
} |
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,7 @@ | ||
* text=auto | ||
*.js eol=lf | ||
*.json eol=lf | ||
*.md eol=lf | ||
*.ts eol=lf | ||
*.tsx eol=lf | ||
*.yml eol=lf |
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,181 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
env: | ||
PRIMARY_NODE_VERSION: 12 | ||
|
||
jobs: | ||
primary_code_validation_and_tests: | ||
name: Primary code validation and tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: echo github.ref | ||
run: echo ${{ github.ref }} | ||
|
||
- name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.PRIMARY_NODE_VERSION }} | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v1 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
# This also runs a build as part of the postinstall bootstrap | ||
- name: Install dependencies and build | ||
run: | | ||
yarn --ignore-engines --frozen-lockfile | ||
yarn check-clean-workspace-after-install | ||
# Note that this command *also* type checks tests/tools, | ||
# whereas the build only checks src files | ||
- name: Typecheck all packages | ||
run: yarn typecheck | ||
|
||
- name: Check code formatting | ||
run: yarn format-check | ||
|
||
- name: Run linting | ||
run: yarn lint | ||
|
||
- name: Validate spelling | ||
run: yarn check:spelling | ||
|
||
- name: Run unit tests | ||
run: yarn test | ||
env: | ||
CI: true | ||
|
||
- name: Publish code coverage report | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
yml: ./codecov.yml | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
flags: unittest | ||
name: codecov | ||
|
||
integration_tests: | ||
name: Run integration tests on primary Node.js version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.PRIMARY_NODE_VERSION }} | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v1 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
# This also runs a build as part of the postinstall bootstrap | ||
- name: Install dependencies and build | ||
run: | | ||
yarn --ignore-engines --frozen-lockfile | ||
yarn check-clean-workspace-after-install | ||
- name: Run integrations tests | ||
run: yarn integration-tests | ||
env: | ||
CI: true | ||
|
||
unit_tests_on_other_node_versions: | ||
name: Run unit tests on other Node.js versions | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [8.x, 10.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v1 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
# This also runs a build as part of the postinstall bootstrap | ||
- name: Install dependencies and build | ||
run: | | ||
yarn --ignore-engines --frozen-lockfile | ||
yarn check-clean-workspace-after-install | ||
- name: Run unit tests | ||
run: yarn test | ||
env: | ||
CI: true | ||
|
||
publish_canary_version: | ||
name: Publish the latest code as a canary version | ||
runs-on: ubuntu-latest | ||
needs: [primary_code_validation_and_tests, unit_tests_on_other_node_versions, integration_tests] | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Fetch all history for all tags and branches in this job because lerna needs it | ||
- run: | | ||
git fetch --prune --unshallow | ||
- name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.PRIMARY_NODE_VERSION }} | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v1 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
# This also runs a build as part of the postinstall bootstrap | ||
- name: Install dependencies and build | ||
run: | | ||
yarn --ignore-engines --frozen-lockfile | ||
yarn check-clean-workspace-after-install | ||
- name: Publish all packages to npm | ||
run: npx lerna publish --loglevel=verbose --canary --exact --force-publish --yes | ||
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,7 @@ | ||
{ | ||
"hooks": { | ||
"pre-commit": "yarn run pre-commit", | ||
"pre-push": "yarn run pre-push", | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
} |
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,5 @@ | ||
**/dist | ||
**/coverage | ||
**/.nyc_output | ||
.github | ||
.all-contributorsrc |
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,3 @@ | ||
{ | ||
"trailingComma": "all" | ||
} |
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.