-
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.
Add cjs support and jest as test runner
- Loading branch information
Showing
17 changed files
with
4,295 additions
and
3,409 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
tags: ["**"] | ||
pull_request: | ||
# Build all pull requests, regardless of what their base branch is. | ||
branches: ["**"] | ||
types: | ||
# Default types (see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request) | ||
- opened | ||
- synchronize | ||
- reopened | ||
# Extra types (re-run CI when marking PR for "ready for review") | ||
- ready_for_review | ||
|
||
# Automatically cancel previous runs for the same ref (i.e. branch) | ||
concurrency: | ||
group: ${{ github.ref }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
token: ${{ secrets.GH_DOTCOM_TOKEN }} | ||
node-version-file: "package.json" | ||
cache: "yarn" | ||
cache-dependency-path: "yarn.lock" | ||
registry-url: "https://registry.npmjs.com" | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile --ignore-scripts --network-concurrency 1 --child-concurrency 1 | ||
- name: Lint code (ESLint) | ||
run: yarn run lint:eslint | ||
- name: Lint code (Prettier) | ||
run: yarn run lint:prettier | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
token: ${{ secrets.GH_DOTCOM_TOKEN }} | ||
node-version-file: "package.json" | ||
cache: "yarn" | ||
cache-dependency-path: "yarn.lock" | ||
registry-url: "https://registry.npmjs.com" | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Run Unit Tests | ||
run: yarn run test:unit | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
token: ${{ secrets.GH_DOTCOM_TOKEN }} | ||
node-version-file: "package.json" | ||
cache: "yarn" | ||
cache-dependency-path: "yarn.lock" | ||
registry-url: "https://registry.npmjs.com" | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile --ignore-scripts --network-concurrency 1 --child-concurrency 1 | ||
- name: Typescript build | ||
run: yarn run build | ||
|
||
publish: | ||
needs: | ||
- lint | ||
- test | ||
- build | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
token: ${{ secrets.GH_DOTCOM_TOKEN }} | ||
node-version-file: "package.json" | ||
cache: "yarn" | ||
cache-dependency-path: "yarn.lock" | ||
registry-url: "https://registry.npmjs.com" | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile --ignore-scripts --network-concurrency 1 --child-concurrency 1 | ||
- name: Publish to NPM | ||
run: yarn publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_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,2 @@ | ||
yarn lint | ||
git update-index --again |
Oops, something went wrong.