Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
ahabhgk committed Sep 18, 2023
2 parents 7b92c8f + 7e0ffe6 commit 735ff8b
Show file tree
Hide file tree
Showing 1,542 changed files with 46,296 additions and 26,612 deletions.
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
crates/rspack/tests
crates/rspack_error/tests
crates/rspack_plugin_css/webpack_css_cases_to_be_migrated
packages/playground/fixtures
packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts
packages/rspack/tests
webpack-examples
webpack-test
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@
## Test Plan

<!-- Can you please describe how you tested the changes you made to the code? -->

## Require Documentation?

<!-- Does this PR require documentation? -->

- [ ] No
- [ ] Yes, the corresponding rspack-website PR is \_\_
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/minor-release-mr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release Template

## Breaking Change List

## Check List
23 changes: 23 additions & 0 deletions .github/issue-close-require.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Issue Close Require

on:
schedule:
- cron: "0 0 * * *"

permissions:
contents: read

jobs:
issue-close-require:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- name: need reproduce
uses: actions-cool/issues-helper@v3
with:
actions: "close-issues"
labels: "need reproduction"
inactive-day: 3
body: |
Since the issue was labeled with `need reproduction`, but no response in 3 days. This issue will be closed. Feel free to comment and reopen it if you have any further questions.
File renamed without changes.
24 changes: 24 additions & 0 deletions .github/workflows/bench-merge-queue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Benchmark Merge Queue

on:
merge_group:
types: [checks_requested]

# cancel previous job runs for the same workflow + pr
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Run Benchmark
uses: convictional/[email protected]
with:
owner: ${{ github.repository_owner }}
repo: 'rspack-ecosystem-benchmark'
workflow_file_name: 'bench_rspack_merge_queue.yml'
github_token: ${{ secrets.RSPACK_BOT_ACCESS_TOKEN }}
ref: 'main'
client_payload: '{"rspack_ref":"${{ github.ref }}"}'
90 changes: 90 additions & 0 deletions .github/workflows/bench-rust.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Benchmark Rust

on:
issue_comment:
types: [created]

# cancel previous job runs for the same workflow + pr
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

env:
RUST_LOG: info
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10

jobs:
bench:
name: Bench
if: github.event.issue.pull_request && contains(github.event.comment.body, '!bench-rust')
runs-on: ubuntu-latest

steps:
- name: Get PR SHA
id: sha
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const response = await github.request(context.payload.issue.pull_request.url);
return response.data.head.sha;
- name: Checkout PR Branch
uses: actions/checkout@v3
with:
submodules: false
ref: ${{ steps.sha.outputs.result }}

- name: Install toolchain
run: rustup show

- name: Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "bench"

- name: Install critcmp
run: cargo install critcmp

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

- name: Run Bench on PR Branch
run: cargo bench --bench main -- --save-baseline pr

- name: Checkout Next Branch
uses: actions/checkout@v3
with:
clean: false
ref: main

- name: Run Bench on Next Branch
run: cargo bench --bench main -- --save-baseline baseline

- name: Compare Bench Results
id: bench_comparison
shell: bash
run: |
echo "### Benchmark Results" > output
echo "\`\`\`" >> output
critcmp baseline pr >> output
echo "\`\`\`" >> output
cat output
comment="$(cat output)"
comment="${comment//'%'/%25}"
comment="${comment//$'\n'/%0A}"
comment="${comment//$'\r'/%0D}"
echo "::set-output name=comment::$comment"
- name: Write a new comment
uses: peter-evans/[email protected]
continue-on-error: true
with:
issue-number: ${{ github.event.issue.number }}
body: |
${{ steps.bench_comparison.outputs.comment }}
- name: Remove Criterion Artifact
run: rm -rf ./target/criterion
90 changes: 0 additions & 90 deletions .github/workflows/bench.yaml

This file was deleted.

84 changes: 84 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Benchmark

on:
issue_comment:
types: [created]

# cancel previous job runs for the same workflow + pr
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
trigger:
runs-on: ubuntu-latest
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '!bench')
steps:
- uses: actions/github-script@v6
with:
script: |
const user = context.payload.sender.login
console.log(`Validate user: ${user}`)
let hasTriagePermission = false
try {
const { data } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: user,
});
hasTriagePermission = data.user.permissions.triage
} catch (e) {
console.warn(e)
}
if (hasTriagePermission) {
console.log('Allowed')
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: '+1',
})
} else {
console.log('Not allowed')
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: '-1',
})
throw new Error('not allowed')
}
- uses: actions/github-script@v6
id: get-pr-data
with:
script: |
console.log(`Get PR info: ${context.repo.owner}/${context.repo.repo}#${context.issue.number}`)
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
})
return {
num: context.issue.number,
branchName: pr.head.ref,
repo: pr.head.repo.full_name
}
- uses: actions/github-script@v6
id: trigger
with:
github-token: ${{ secrets.RSPACK_BOT_ACCESS_TOKEN }}
result-encoding: string
script: |
const prData = ${{ steps.get-pr-data.outputs.result }}
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'rspack-ecosystem-benchmark',
workflow_id: 'bench_rspack_pr.yml',
ref: 'main',
inputs: {
prNumber: '' + prData.num
}
})
Loading

0 comments on commit 735ff8b

Please sign in to comment.