-
-
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.
- Loading branch information
0 parents
commit aed62b5
Showing
32 changed files
with
4,845 additions
and
0 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,27 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:jest/recommended" | ||
], | ||
"overrides": [ | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"eslint-plugin-jest" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-var-requires": "off", | ||
"no-console": "warn" | ||
} | ||
} |
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 @@ | ||
github: santi100a |
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,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: npm # See documentation for possible values | ||
directory: / # Location of package manifests | ||
schedule: | ||
interval: weekly |
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 @@ | ||
'CI failed': '**/*.*' |
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,19 @@ | ||
name: Check for broken Markdown links | ||
|
||
on: | ||
schedule: | ||
- cron: 0 0 * * * | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
check-links: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 19.x | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Run link check | ||
run: yarn check-links |
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,130 @@ | ||
name: Continuous Integration (CI) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- src/**/*.* | ||
|
||
jobs: | ||
test: | ||
outputs: | ||
rel: ${{ steps.commit.outputs.rel }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 19.x | ||
always-auth: true | ||
|
||
- name: Check commit message | ||
id: commit | ||
run: | | ||
COMMIT_MSG=$(/usr/bin/git log --format=%B -n 1 HEAD) | ||
STRING=$(echo $COMMIT_MSG | (grep -E "infra:|docs:|lint:|code-style:" || echo '')) | ||
if [ -z "$STRING" ]; then | ||
echo "rel=1" >> $GITHUB_OUTPUT | ||
echo "IS_RELEASE_COMMIT=1" >> $GITHUB_ENV | ||
else | ||
echo "This commit will NOT trigger a release." | ||
echo "rel=0" >> $GITHUB_OUTPUT | ||
echo "IS_RELEASE_COMMIT=0" >> $GITHUB_ENV | ||
fi | ||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Validate Markdown links | ||
run: yarn check-links | ||
|
||
- name: Validate package.json | ||
run: yarn validate-package-json | ||
|
||
- name: Run ESLint | ||
run: yarn lint | ||
|
||
- name: Build source code | ||
run: yarn build | ||
|
||
- name: Run test suites | ||
run: yarn test | ||
release: | ||
needs: test | ||
if: needs.test.outputs.rel == 1 || needs.test.outputs.rel == '1' | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Generate tag, release name, and body | ||
run: | | ||
TAG_NAME="v$(jq -r '.version' package.json)" | ||
RELEASE_NAME="Release $TAG_NAME" | ||
BODY=$(sed -n "/## Version $(jq -r '.version' package.json | sed 's/\./\\\./g')/,/##/p" CHANGELOG.md | sed '1d;/^##/d') | ||
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | ||
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV | ||
echo "$BODY" >> release.md | ||
- name: Create release | ||
uses: ncipollo/release-action@v1.12.0 | ||
with: | ||
allowUpdates: true | ||
tag: ${{ env.TAG_NAME }} | ||
name: ${{ env.RELEASE_NAME }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
bodyFile: release.md | ||
draft: false | ||
prerelease: false | ||
publish-npm: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 19.x | ||
always-auth: true | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Build code | ||
run: yarn build | ||
- name: Set authentication token | ||
run: | | ||
npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_AUTH_TOKEN }} | ||
- name: Publish to NPM | ||
run: yarn publish --access public | ||
publish-gpr: | ||
needs: release | ||
permissions: | ||
packages: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 19.x | ||
always-auth: true | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Build code | ||
run: yarn build | ||
|
||
- name: Set authentication token | ||
run: | | ||
npm set //npm.pkg.github.com/:_authToken ${{ secrets.GPR_AUTH_TOKEN }} | ||
- name: Get ready to publish to GPR | ||
run: | | ||
jq ".name = \"@$REPO\"" package.json > temp.json && mv temp.json package.json | ||
env: | ||
REPO: ${{ github.repository }} | ||
- name: Publish to GPR | ||
run: yarn publish --access public --registry https://npm.pkg.github.com/ |
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,21 @@ | ||
name: Welcome message for issues | ||
on: | ||
issues: | ||
types: | ||
- opened | ||
permissions: | ||
issues: write | ||
jobs: | ||
welcome-author: | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Say hi | ||
uses: jungwinter/comment@v1 | ||
with: | ||
type: create | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue_number: ${{ github.event.issue.number }} | ||
body: | | ||
Hi, ${{ github.actor }}! | ||
Make sure to comply with the [Code of Conduct](https://github.com/${{ github.repository }}/blob/main/CODE_OF_CONDUCT.md), [security policy](https://github.com/${{ github.repository }}/blob/main/SECURITY.md) and [contribution guidelines](https://github.com/${{ github.repository }}/blob/main/CONTRIBUTING.md) before contributing to this repo. |
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,31 @@ | ||
name: Report PR build failed | ||
on: | ||
workflow_call: | ||
inputs: | ||
number: | ||
required: true | ||
type: number | ||
pr-author: | ||
required: true | ||
type: string | ||
jobs: | ||
report-pr-build-failed: | ||
continue-on-error: true | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Report the build failed | ||
uses: jungwinter/comment@v1 | ||
with: | ||
type: create | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue_number: ${{ inputs.number }} | ||
body: | | ||
Hi, @${{ inputs.pr-author }}! I'm afraid the CI check for PR #${{ inputs.number }} has failed! | ||
Don't worry, it'll run again if you commit any changes to this PR. | ||
- name: Label PR as "CI failed" | ||
uses: actions/labeler@v4 | ||
with: | ||
sync-label: true | ||
repo-token: ${{ secrets.GITHUB_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,105 @@ | ||
name: Pull Request check | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- edited | ||
- opened | ||
- synchronize | ||
jobs: | ||
say-hi: | ||
continue-on-error: true | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Say hi | ||
uses: jungwinter/comment@v1 | ||
with: | ||
type: create | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue_number: ${{ github.event.pull_request.number }} | ||
body: | | ||
Hi, ${{ github.actor }}! | ||
Make sure to comply with the [Code of Conduct](https://github.com/${{ github.repository }}/blob/main/CODE_OF_CONDUCT.md), [security policy](https://github.com/${{ github.repository }}/blob/main/SECURITY.md) and [contribution guidelines](https://github.com/${{ github.repository }}/blob/main/CONTRIBUTING.md) before contributing to this repo. | ||
test: | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout PR | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Validate package.json | ||
run: yarn validate-package-json | ||
|
||
- name: Validate Markdown links | ||
run: yarn check-links | ||
|
||
- name: Run ESLint | ||
run: yarn lint | ||
|
||
- name: Build code | ||
run: yarn build | ||
|
||
- name: Run main test suites | ||
run: yarn test | ||
|
||
- name: Report build failed (if any) | ||
if: failure() | ||
uses: ./.github/workflows/pr-build-failed.yml | ||
with: | ||
pr-author: ${{ github.event.pull_request.user.login }} | ||
number: ${{ github.event.pull_request.number }} | ||
assign-and-ping: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Check CI status | ||
id: ci-check | ||
uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const { data } = await github.checks.listForRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: context.payload.pull_request.head.sha, | ||
}); | ||
const latestCheck = data.check_runs[0]; | ||
return latestCheck.conclusion === 'success'; | ||
- name: Assign pull request to yourself | ||
if: steps.ci-check.outputs.result == 'true' | ||
uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const assignResponse = await github.issues.addAssignees({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.pull_request.number, | ||
assignees: [context.actor], | ||
}); | ||
- name: Request code review | ||
if: steps.ci-check.outputs.result == 'true' | ||
uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const requestReviewResponse = await github.pulls.createReviewRequest({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.payload.pull_request.number, | ||
reviewers: [context.actor], | ||
}); |
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 @@ | ||
node_modules | ||
*.exe | ||
ignore-*.* | ||
*.log | ||
coverage |
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,6 @@ | ||
{ | ||
"bracketSameLine": true, | ||
"semi": true, | ||
"singleQuote": true, | ||
"useTabs": 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,6 @@ | ||
{ | ||
"plugins": [ | ||
"gfm", | ||
"validate-links" | ||
] | ||
} |
Oops, something went wrong.