Skip to content

Commit

Permalink
Merge branch 'main' into fix/6078
Browse files Browse the repository at this point in the history
  • Loading branch information
hulin32 authored May 18, 2024
2 parents a1765a0 + 549ab61 commit 18634e1
Show file tree
Hide file tree
Showing 2,576 changed files with 36,625 additions and 29,678 deletions.
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
**/tests
**/fixtures
**/dist
crates/rspack_plugin_css/webpack_css_cases_to_be_migrated
crates/rspack_plugin_mf
crates/rspack_plugin_extract_css/src/runtime
packages/rspack/compiled
packages/rspack-dev-server/client
packages/rspack-plugin-react-refresh/client
packages/playground
packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts
packages/rspack-test-tools/template
Expand All @@ -13,3 +18,5 @@ diffcases
scripts/test/diff.cjs
scripts/test/binary-path.cjs
plugin-test
benchcases
scripts
2 changes: 2 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
- "/^perf/"
"release: bug fix":
- "/^fix/"
"release: document":
- "/^docs/"
3 changes: 3 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ changelog:
- title: Bug Fixes 🐞
labels:
- "release: bug fix"
- title: Document Updates 📖
labels:
- "release: document"
- title: Other Changes
labels:
- "*"
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"webpack-examples/**",
"webpack-test/**"
],
"assignees": ["@Boshen"],
"assignees": [],
"packageRules": [
{
"groupName": "github-actions",
Expand Down
1 change: 0 additions & 1 deletion .github/teams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ team:
- "@hyf0"
- "@underfin"
- "@jerrykingxyz"
- "@Boshen"
- "@chenjiahan"
- "@JSerFeng"
- "@9aoy"
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: dorny/paths-filter@v3
id: filter
with:
predicate-quantifier: 'every'
predicate-quantifier: "every"
filters: |
changed:
- "!**/*.md"
Expand Down Expand Up @@ -176,6 +176,10 @@ jobs:
if: steps.changes.outputs.src == 'true'
run: pnpm run lint:js

- name: Eslint
if: steps.changes.outputs.src == 'true'
run: pnpm run eslint:js

- name: Prettier
if: steps.changes.outputs.src == 'true'
run: pnpm run format-ci:js
Expand Down Expand Up @@ -316,7 +320,7 @@ jobs:
owner: ${{ github.repository_owner }}
repo: "rspack-ecosystem-benchmark"
workflow_file_name: "bench_rspack_commit.yml"
github_token: ${{ secrets.RSPACK_BOT_ACCESS_TOKEN }}
github_token: ${{ secrets.RSPACK_ACCESS_TOKEN }}
ref: "main"
client_payload: '{"commit_sha":"${{ github.sha }}"}'

Expand All @@ -333,7 +337,7 @@ jobs:
owner: ${{ github.repository_owner }}
repo: "rspack-ecosystem-ci"
workflow_file_name: "ecosystem-ci-from-commit.yml"
github_token: ${{ secrets.ECOSYSTEM_CI_ACCESS_TOKEN }}
github_token: ${{ secrets.RSPACK_ACCESS_TOKEN }}
ref: "main"
client_payload: '{"commitSHA":"${{ github.sha }}","repo":"web-infra-dev/rspack","suite":"-","suiteRefType":"precoded","suiteRef":"precoded"}'

Expand All @@ -357,14 +361,7 @@ jobs:
failure_notification:
name: Failure Notification
needs:
[
test-linux,
test-windows,
test-mac,
rust_check,
rust_test,
run_benchmark
]
[test-linux, test-windows, test-mac, rust_check, rust_test, run_benchmark]
if: ${{ failure() && !cancelled() && github.ref_name == 'main' && github.repository_owner == 'web-infra-dev' }}
runs-on: ubuntu-latest
steps:
Expand Down
120 changes: 0 additions & 120 deletions .github/workflows/diff.yml

This file was deleted.

120 changes: 120 additions & 0 deletions .github/workflows/diff.yml.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Diff assets comment with "!diff"

name: Diff Assets

on:
pull_request_review_comment:
types: [created]
issue_comment:
types: [created]

jobs:
get-runner-labels:
name: Get Runner Labels
uses: ./.github/workflows/get-runner-labels.yml

build:
name: Build
needs: [get-runner-labels]
if: (github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment') && contains(github.event.comment.body, '!diff')
strategy:
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:
profile: "debug"
ref: refs/pull/${{ github.event.issue.number || github.event.pull_request.number }}/merge
target: ${{ matrix.array.target }}
runner: ${{ matrix.array.runner }}
test: false

diff:
name: Diff Assets
needs: [build, get-runner-labels]
runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }}
steps:
- name: Checkout Branch
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: refs/pull/${{ github.event.issue.number || github.event.pull_request.number }}/merge

- name: Pnpm Cache
uses: ./.github/actions/pnpm-cache

- name: Download bindings
uses: ./.github/actions/download-artifact
with:
name: bindings-x86_64-unknown-linux-gnu
path: crates/node_binding/
try-local-cache: true
link-when-local: true

- name: Build node packages
run: pnpm run build:js

- name: Run Diff
run: node scripts/diff.cjs

- name: Upload Report
shell: bash
env:
API_TOKEN_GITHUB: ${{ secrets.RSPACK_ACCESS_TOKEN }}
run: |
cache_dir="$HOME/.cache/diff_upload"
clone_dir="$cache_dir/${{ github.run_id }}"

# Cleaning history upload cache
if [ -d $cache_dir ]
then
find $cache_dir -type d -maxdepth 1 -mindepth 1 -cmin +180 | xargs rm -rf
fi

# Cloning into dest directory
mkdir -p $clone_dir
git config --global user.email "[email protected]"
git config --global user.name "LingyuCoder"
git clone --single-branch --branch main "https://x-access-token:[email protected]/web-infra-dev/rspack-report-website.git" $clone_dir

# Copying content into dest repo
dest_dir="$clone_dir/diff/${{ github.run_id }}"
cp -R diff_output/. $dest_dir

# Committing and pushing
cd $clone_dir

current_time=$(date +%s)
gap=$((30 * 24 * 60 * 60))
for cur_dir in ./diff/* ; do
create_time=$(git log --follow --format="%at" --date default $cur_dir | tail -1)
diff=$(($current_time - $create_time))
if [ $diff -gt $gap ]; then
echo "Remove $cur_dir because it is older than a month"
rm -rf $cur_dir
fi
done

commit_message="Update from https://github.com/web-infra-dev/rspack/commit/${{ github.sha }}"
git add .
if LC_ALL=C git status | grep -q "Changes to be committed"
then
git commit --message "$commit_message"
git push -u origin HEAD:main
else
echo "No changes detected"
fi

# Cleaning upload cache
if [ -d $clone_dir ]
then
rm -rf $clone_dir
fi

- name: Write a new comment
uses: peter-evans/create-or-update-comment@v4
continue-on-error: true
with:
issue-number: ${{ github.event.issue.number || github.event.pull_request.number }}
body-path: 'diff_output/stats.md'
2 changes: 1 addition & 1 deletion .github/workflows/ecosystem-ci-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
env:
COMMENT: ${{ github.event.comment.body }}
with:
github-token: ${{ secrets.ECOSYSTEM_CI_ACCESS_TOKEN }}
github-token: ${{ secrets.RSPACK_ACCESS_TOKEN }}
result-encoding: string
script: |
const comment = process.env.COMMENT.trim()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-issue-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# This is a Personal Access Token and it needs to have the following permissions
# - "read:org": used to read the project's board
# - "write:org": used to assign issues to the project's board
PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }}
PROJECT_TOKEN: ${{ secrets.RSPACK_ACCESS_TOKEN }}
# The number of the project which the issues will be synced to
# You can find this in https://github.com/orgs/@ORGANIZATION/projects/<NUMBER>
project: 12
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issue-pr-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
node-version: '20'
- name: Check if triggered by project member
id: check_member
if: github.event.sender.type == 'User'
if: github.event.sender.type == 'User' && github.actor != 'renovate'
run: |
SENDER=${{ github.event.sender.login }}
TEAMS_FILE="./.github/teams.yml"
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Notify Lark for Issue
if: steps.check_member.outputs.skip != 'true' && github.event_name == 'issues'
env:
LARK_WEBHOOK_URL: ${{ secrets.LARK_WEBHOOK_URL }}
LARK_WEBHOOK_URL: ${{ secrets.LARK_CONTRIBUTION_HOOK }}
ISSUE_TITLE: ${{ github.event.issue.title }}
AUTHOR_ID: ${{ github.event.issue.user.login }}
BODY: ${{ github.event.issue.body }}
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Notify Lark for PR
if: steps.check_member.outputs.skip != 'true' && github.event_name == 'pull_request'
env:
LARK_WEBHOOK_URL: ${{ secrets.LARK_WEBHOOK_URL }}
LARK_WEBHOOK_URL: ${{ secrets.LARK_CONTRIBUTION_HOOK }}
PR_TITLE: ${{ github.event.pull_request.title }}
AUTHOR_ID: ${{ github.event.pull_request.user.login }}
BODY: ${{ github.event.pull_request.body }}
Expand Down
Loading

0 comments on commit 18634e1

Please sign in to comment.