-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from eric2788/develop
v2.0.2 update
- Loading branch information
Showing
137 changed files
with
25,207 additions
and
1,638 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 |
---|---|---|
@@ -1,22 +1,25 @@ | ||
name: Build And Test Extensions | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'develop' | ||
push: | ||
branches: [develop] | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- 'playwright.config.ts' | ||
- 'pnpm-lock.yaml' | ||
- '.github/workflows/build-test.yml' | ||
pull_request: | ||
branches: [develop] | ||
branches: [develop, master] | ||
types: | ||
- opened | ||
- reopened | ||
- ready_for_review | ||
- review_requested | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- 'playwright.config.ts' | ||
- 'pnpm-lock.yaml' | ||
- '.github/workflows/build-test.yml' | ||
workflow_dispatch: | ||
inputs: | ||
debug: | ||
|
@@ -27,13 +30,14 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && contains(github.event.head_commit.message, '[run ci]')) }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
browser: [chrome, edge, chromium] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
- name: Setup Node.js | ||
|
@@ -45,15 +49,63 @@ jobs: | |
run: pnpm install --frozen-lockfile | ||
- name: Build And Package Extensions | ||
run: pnpm build --zip --target=${{ matrix.browser }}-mv3 | ||
env: | ||
DEBUG: true | ||
# upload to github artifacts for each browser with matrix | ||
- name: Upload to GitHub Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.browser }}-mv3 | ||
path: build/ | ||
test: | ||
test: # non-e2e test no need upload to r2 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
project: [integrations, units] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Ensure No @Scoped Test | ||
run: grep -r --include "*.spec.ts" "@scoped" && echo "please remove @scoped from tests" && exit 1 || echo "No @scoped tests found" | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Cache playwright binaries | ||
uses: actions/cache@v3 | ||
id: playwright-cache | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
- name: Install Playwright Browsers | ||
run: pnpm exec playwright install --with-deps | ||
if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
- name: Test | ||
id: test | ||
run: | | ||
if [ "${{ inputs.debug }}" == "true" ]; then | ||
echo "Enabled Debug Mode" | ||
export DEBUG=true | ||
fi | ||
pnpm test -- --project=${{ matrix.project }} --max-failures=5 | ||
- name: Upload Test Results | ||
if: always() && steps.test.conclusion != 'skipped' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.project }}-test-results | ||
path: | | ||
test-results/ | ||
playwright-report/ | ||
if-no-files-found: ignore | ||
e2e-test: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
needs: [build, test] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -71,7 +123,7 @@ jobs: | |
path: build/ | ||
- name: Unzip artifacts | ||
run: unzip build/${{ matrix.browser }}-mv3-prod.zip -d build/extension | ||
- uses: pnpm/action-setup@v2 | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
- name: Setup Node.js | ||
|
@@ -100,7 +152,7 @@ jobs: | |
run: | | ||
if [ "${{ inputs.debug }}" == "true" ]; then | ||
echo "Enabled Debug Mode" | ||
export DEBUG="pw:api" | ||
export DEBUG=true | ||
fi | ||
pnpm test -- --project=${{ steps.project.outputs.project }} | ||
- name: Upload Test Results | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ on: | |
- 'tests/**' | ||
- 'playwright.config.ts' | ||
- 'pnpm-lock.yaml' | ||
- '.github/workflows/build-test.yml' | ||
workflow_dispatch: | ||
inputs: | ||
debug: | ||
|
@@ -21,13 +20,50 @@ on: | |
jobs: | ||
fast-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
project: [units, integrations] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Cache playwright binaries | ||
uses: actions/cache@v3 | ||
id: playwright-cache | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
- run: pnpm exec playwright install --with-deps | ||
if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
- name: Test | ||
id: test | ||
run: | | ||
pnpm test -- --project=${{ matrix.project }} \ | ||
--grep=@scoped \ | ||
--pass-with-no-tests \ | ||
--global-timeout=3600000 \ | ||
--max-failures=2 | ||
env: | ||
DEBUG: true | ||
fast-e2e-test: | ||
runs-on: ubuntu-latest | ||
needs: fast-test | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
browser: [chrome, edge] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
- name: Setup Node.js | ||
|
@@ -39,6 +75,8 @@ jobs: | |
run: pnpm install --frozen-lockfile | ||
- name: Build Extension and Prepare Tests | ||
run: pnpm test:rebuild | ||
env: | ||
DEBUG: true | ||
- name: Cache playwright binaries | ||
uses: actions/cache@v3 | ||
id: playwright-cache | ||
|
@@ -57,4 +95,13 @@ jobs: | |
--timeout=60000 \ | ||
--max-failures=5 | ||
env: | ||
DEBUG: true | ||
DEBUG: true | ||
- name: Upload Test Results | ||
if: failure() && steps.test.conclusion != 'skipped' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.browser }}-test-results | ||
path: | | ||
test-results/ | ||
playwright-report/ | ||
if-no-files-found: ignore |
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 |
---|---|---|
|
@@ -22,6 +22,7 @@ npm-debug.log* | |
|
||
# local env files | ||
.env* | ||
.vscode/ | ||
|
||
out/ | ||
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
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
Oops, something went wrong.