-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Update github actions for formatting and unit tests (#6)
Splits Unit tests from E2E tests, formatting, linting, and build to ensure consistency across pull requests.
- Loading branch information
1 parent
fb2f508
commit 12d4802
Showing
9 changed files
with
154 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,19 @@ | ||
name: "Run optimized SDK build" | ||
description: | | ||
Run build for Browser, Node, and Types | ||
runs: | ||
using: composite | ||
steps: | ||
# Install node and pnpm. | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .node-version | ||
registry-url: "https://registry.npmjs.org" | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.9.0 | ||
|
||
# Run package install and build | ||
- run: pnpm install --frozen-lockfile && pnpm build | ||
shell: bash |
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: "Verify SDK formatting" | ||
description: | | ||
Run prettier on the codebase to ensure consistency | ||
runs: | ||
using: composite | ||
steps: | ||
# Install node and pnpm. | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .node-version | ||
registry-url: "https://registry.npmjs.org" | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.9.0 | ||
|
||
# Verify that the format is correct | ||
- run: pnpm install --frozen-lockfile && pnpm _fmt --check | ||
shell: bash |
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: "Lint SDK Code" | ||
description: | | ||
Run eslint on the codebase to ensure consistency | ||
runs: | ||
using: composite | ||
steps: | ||
# Install node and pnpm. | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .node-version | ||
registry-url: "https://registry.npmjs.org" | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.9.0 | ||
|
||
# Run eslint | ||
- run: pnpm install --frozen-lockfile && pnpm lint | ||
shell: bash |
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: "SDK Unit Tests" | ||
description: | | ||
Run the SDK unit tests locally | ||
runs: | ||
using: composite | ||
steps: | ||
# Install node and pnpm. | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .node-version | ||
registry-url: "https://registry.npmjs.org" | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.9.0 | ||
|
||
# Run unit tests | ||
- run: pnpm install --frozen-lockfile && pnpm unit-test | ||
shell: bash |
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 @@ | ||
env: | ||
GIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
name: "Run SDK optimized build" | ||
on: | ||
pull_request: | ||
types: [labeled, opened, synchronize, reopened, auto_merge_enabled] | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.GIT_SHA }} | ||
- uses: ./.github/actions/run-build |
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 @@ | ||
env: | ||
GIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
name: "Run SDK code format check" | ||
on: | ||
pull_request: | ||
types: [labeled, opened, synchronize, reopened, auto_merge_enabled] | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.GIT_SHA }} | ||
- uses: ./.github/actions/run-fmt |
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 @@ | ||
env: | ||
GIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
name: "Run SDK code linting" | ||
on: | ||
pull_request: | ||
types: [labeled, opened, synchronize, reopened, auto_merge_enabled] | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.GIT_SHA }} | ||
- uses: ./.github/actions/run-lint |
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 @@ | ||
env: | ||
GIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
name: "Run SDK unit tests" | ||
on: | ||
pull_request: | ||
types: [labeled, opened, synchronize, reopened, auto_merge_enabled] | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.GIT_SHA }} | ||
- uses: ./.github/actions/run-unit-tests |
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