-
-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code Style & Performance Optimizations (#334)
- Loading branch information
Showing
26 changed files
with
830 additions
and
574 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
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,14 @@ | ||
# See https://github.com/actions/cache/blob/main/examples.md#node---npm | ||
name: Setup NPM cache | ||
runs: | ||
using: composite | ||
steps: | ||
- id: npm-cache-dir | ||
run: echo "::set-output name=dir::$(npm config get cache)" | ||
shell: bash | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- |
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,104 @@ | ||
# Continuous Integration | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint-format: | ||
name: Lint & Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Setup NPM cache | ||
uses: ./.github/actions/setup-npm-cache | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
- name: Format | ||
run: npm run format | ||
|
||
test: | ||
name: Test (Node.js ${{ matrix.node }} on ${{ matrix.os.name }}) | ||
runs-on: ${{ matrix.os.version }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: | ||
- 12 | ||
- 14 | ||
- 16 | ||
- 17 | ||
os: | ||
- name: Ubuntu | ||
version: ubuntu-latest | ||
- name: Windows | ||
version: windows-latest | ||
- name: macOS | ||
version: macOS-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Setup NPM cache | ||
uses: ./.github/actions/setup-npm-cache | ||
|
||
- name: Print versions | ||
run: | | ||
node --version | ||
npm --version | ||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Test | ||
run: npm test | ||
shell: bash | ||
env: | ||
SHELL: '/bin/bash' | ||
|
||
- name: Submit coverage | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
flag-name: Node.js ${{ matrix.node }} on ${{ matrix.os.name }} | ||
parallel: true | ||
|
||
coverage: | ||
name: Coverage | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Finish coverage | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
parallel-finished: 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
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,11 @@ | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
transform: { | ||
'^.+\\.(t|j)sx?$': ['@swc/jest'], | ||
}, | ||
collectCoverage: true, | ||
collectCoverageFrom: ['src/**/*.ts', '!src/index.ts'], | ||
testPathIgnorePatterns: ['/node_modules/', '/dist'], | ||
}; | ||
|
||
module.exports = config; |
Oops, something went wrong.