-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
47 changed files
with
6,614 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,6 @@ | ||
DEBUG="false" | ||
WATCH="false" | ||
BUILD="production" | ||
|
||
SENTRY_DSN_TOKEN="" | ||
NPM_AUTH_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,39 @@ | ||
{ | ||
"env": { | ||
"node": true, | ||
"es2020": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"indent": [ | ||
"error", | ||
2 | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"@typescript-eslint/no-explicit-any": [ | ||
"off" | ||
] | ||
} | ||
} |
Validating CODEOWNERS rules …
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 @@ | ||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence,they will | ||
# be requested for review when someone opens a pull request. | ||
* @hCaptcha/react-reviewers | ||
|
||
# Javascript Owners | ||
*.js @hCaptcha/react-reviewers | ||
|
||
# Github Action Owners | ||
.github/actions @hCaptcha/react-reviewers | ||
.github/workflow @hCaptcha/react-reviewers |
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,23 @@ | ||
name: Install dependencies | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- name: Setup dependency cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install |
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,18 @@ | ||
name: Setup environment | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 8.x | ||
run_install: false | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'pnpm' | ||
registry-url: 'https://registry.npmjs.org' |
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,24 @@ | ||
name: Install playwright | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Store Playwright's Version | ||
shell: bash | ||
run: | | ||
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --depth 0 | grep @playwright | sed 's/.*@//') | ||
echo "Playwright's Version: $PLAYWRIGHT_VERSION" | ||
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV | ||
- name: Cache playwright browsers per version | ||
id: cache-playwright-browsers | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} | ||
|
||
- name: Setup playwright | ||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: npx playwright install --with-deps |
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,12 @@ | ||
name: Setup environment and dependencies | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Setup environment | ||
uses: ./.github/actions/environment | ||
- name: Install dependencies | ||
uses: ./.github/actions/dependencies | ||
- name: Install playwright browsers | ||
uses: ./.github/actions/playwright |
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,30 @@ | ||
name: CD | ||
|
||
on: | ||
release: | ||
types: [ released ] | ||
|
||
jobs: | ||
|
||
publish: | ||
name: Publish | ||
environment: npm | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out branch | ||
uses: actions/checkout@v3 | ||
- name: Setup environment and dependencies | ||
uses: ./.github/actions/setup | ||
- name: Build lib | ||
shell: bash | ||
run: pnpm run build:lib | ||
env: | ||
BUILD: production | ||
DEBUG: false | ||
SENTRY_DSN_TOKEN: ${{ secrets.SENTRY_DSN_TOKEN }} | ||
- name: Publish package | ||
shell: bash | ||
run: pnpm publish --no-git-checks --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_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,47 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
CI: true | ||
|
||
jobs: | ||
|
||
setup: | ||
name: Setup | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out branch | ||
uses: actions/checkout@v3 | ||
- name: Setup environment and dependencies | ||
uses: ./.github/actions/setup | ||
|
||
test_integration: | ||
name: Test Integration | ||
runs-on: ubuntu-latest | ||
|
||
needs: [Setup] | ||
|
||
steps: | ||
- name: Check out branch | ||
uses: actions/checkout@v3 | ||
- name: Setup environment and dependencies | ||
uses: ./.github/actions/setup | ||
- name: Run Build | ||
run: pnpm run build:lib | ||
env: | ||
BUILD: production | ||
DEBUG: false | ||
- run: pnpm run test:integration | ||
env: | ||
CI: true | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-results | ||
path: playwright/__test__/test-results/ | ||
retention-days: 30 |
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,53 @@ | ||
name: Pull Request | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
- '!main' | ||
pull_request: | ||
branches: | ||
- '**' | ||
- '!main' | ||
|
||
jobs: | ||
|
||
setup: | ||
name: Setup | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out branch | ||
uses: actions/checkout@v3 | ||
- name: Setup environment and dependencies | ||
uses: ./.github/actions/setup | ||
|
||
test_style: | ||
name: Lint & Typecheck | ||
runs-on: ubuntu-latest | ||
|
||
needs: [setup] | ||
|
||
steps: | ||
- name: Check out branch | ||
uses: actions/checkout@v3 | ||
- name: Setup environment and dependencies | ||
uses: ./.github/actions/setup | ||
- name: Check Lint | ||
run: pnpm run test:lint | ||
- name: Check Types | ||
run: pnpm run test:types | ||
|
||
test_unit: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
|
||
needs: [setup] | ||
|
||
steps: | ||
- name: Check out branch | ||
uses: actions/checkout@v3 | ||
- name: Setup environment and dependencies | ||
uses: ./.github/actions/setup | ||
- name: Run Unit Tests | ||
run: pnpm run test:unit |
Oops, something went wrong.