-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
LingyuCoder
committed
Nov 30, 2023
1 parent
ebf1704
commit 093d52c
Showing
2 changed files
with
89 additions
and
8 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,79 @@ | ||
## This file is just for test, should be delete before review | ||
|
||
name: Diff Assets Test | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
push: | ||
branches: | ||
- "ci/diff-html-reporter" | ||
|
||
jobs: | ||
get-runner-labels: | ||
name: Get Runner Labels | ||
uses: ./.github/workflows/get-runner-labels.yml | ||
|
||
build: | ||
name: Build | ||
needs: [get-runner-labels] | ||
strategy: | ||
fail-fast: false # Build and test everything so we can look at all the errors | ||
matrix: | ||
array: | ||
- target: x86_64-unknown-linux-gnu # For Cloud IDE | ||
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }} | ||
uses: ./.github/workflows/reusable-build.yml | ||
with: | ||
target: ${{ matrix.array.target }} | ||
runner: ${{ matrix.array.runner }} | ||
test: false | ||
|
||
diff: | ||
name: Diff Assets | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout Branch | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Pnpm Cache | ||
uses: ./.github/actions/pnpm-cache | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: artifacts | ||
|
||
- name: Build node packages | ||
run: pnpm run build:js | ||
|
||
- name: Move artifacts | ||
run: node scripts/build-npm.cjs | ||
|
||
- name: Build Viewer | ||
run: pnpm run build:viewer | ||
|
||
- name: Run Diff | ||
run: node scripts/diff.cjs | ||
|
||
- name: Upload Report | ||
uses: dmnemec/copy_file_to_another_repo_action@main | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.RSPACK_REPORT_ACCESS_TOKEN }} | ||
with: | ||
source_file: 'diff_output' | ||
destination_repo: 'web-infra-dev/rspack-report-website' | ||
destination_folder: 'diff/$GITHUB_RUN_ID' | ||
user_email: '[email protected]' | ||
user_name: 'LingyuCoder' | ||
commit_message: 'Auto upload diff report' | ||
|
||
- name: Write a new comment | ||
uses: peter-evans/create-or-update-comment@v3 | ||
continue-on-error: true | ||
with: | ||
issue-number: ${{ github.event.issue.number }} | ||
body-path: 'diff_output/stats.md' |
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 |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
name: Diff Assets | ||
|
||
on: | ||
workflow_dispatch: | ||
issue_comment: | ||
types: [created] | ||
|
||
|
@@ -60,14 +59,17 @@ jobs: | |
- name: Run Diff | ||
run: node scripts/diff.cjs | ||
|
||
- name: Upload Diff Report | ||
id: upload-artifact | ||
uses: ./.github/actions/upload-artifact | ||
- name: Upload Report | ||
uses: dmnemec/copy_file_to_another_repo_action@main | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.RSPACK_REPORT_ACCESS_TOKEN }} | ||
with: | ||
name: diff-report | ||
path: diff_output | ||
try-local-cache: false | ||
mv-when-local: false | ||
source_file: 'diff_output' | ||
destination_repo: 'web-infra-dev/rspack-report-website' | ||
destination_folder: 'diff/$GITHUB_RUN_ID' | ||
user_email: '[email protected]' | ||
user_name: 'LingyuCoder' | ||
commit_message: 'Auto upload diff report' | ||
|
||
- name: Write a new comment | ||
uses: peter-evans/create-or-update-comment@v3 | ||
|