fix(tree-shaking): handle nested pure function calls #38798
Workflow file for this run
This file contains hidden or 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
| name: CI | |
| on: | |
| merge_group: | |
| types: [checks_requested] | |
| workflow_dispatch: | |
| inputs: | |
| debug_enabled: | |
| type: boolean | |
| description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | |
| required: false | |
| default: false | |
| pull_request: | |
| types: [opened, synchronize] | |
| push: | |
| branches: | |
| - main | |
| - v1.x | |
| paths-ignore: | |
| - '**/*.md' | |
| - 'website/**' | |
| tags-ignore: | |
| - '**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: ${{ github.ref_name != 'main' && github.ref_name != 'v1.x' }} | |
| permissions: | |
| # Allow commenting on issues for `reusable-build.yml` | |
| issues: write | |
| # Allow commenting on pull requests for `size-limit.yml` | |
| pull-requests: write | |
| jobs: | |
| check-changed: | |
| runs-on: rspack-ubuntu-22.04-mini | |
| name: Check Source Changed | |
| outputs: | |
| code_changed: ${{ steps.filter.outputs.code_changed == 'true' }} | |
| document_changed: ${{ steps.filter.outputs.document_changed == 'true' }} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4 | |
| id: filter | |
| with: | |
| predicate-quantifier: 'every' | |
| filters: | | |
| code_changed: | |
| - "!**/*.md" | |
| - "!**/*.mdx" | |
| - "!website/**" | |
| document_changed: | |
| - "website/**" | |
| build-linux: | |
| name: Build Linux | |
| needs: [check-changed] | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' }} | |
| uses: ./.github/workflows/reusable-build-build.yml | |
| with: | |
| target: x86_64-unknown-linux-gnu | |
| profile: 'ci' | |
| runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }} | |
| test-linux: | |
| name: Test Linux | |
| needs: [check-changed, build-linux] | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' }} | |
| uses: ./.github/workflows/reusable-build-test.yml | |
| with: | |
| target: x86_64-unknown-linux-gnu | |
| runner: '"ubuntu-22.04"' | |
| bench-binding: | |
| name: Bench Binding | |
| needs: [check-changed, build-linux] | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' }} | |
| uses: ./.github/workflows/bench-binding.yml | |
| with: | |
| target: x86_64-unknown-linux-gnu | |
| runner: '"ubuntu-22.04"' | |
| bench-rust: | |
| name: Rust Bench | |
| needs: [check-changed] | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' }} | |
| uses: ./.github/workflows/bench-rust.yml | |
| with: | |
| target: x86_64-unknown-linux-gnu | |
| runner: '"ubuntu-22.04"' | |
| bench-rust-walltime: | |
| name: Rust Bench Walltime | |
| needs: [check-changed] | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' }} | |
| uses: ./.github/workflows/bench-rust.yml | |
| with: | |
| target: x86_64-unknown-linux-gnu | |
| measurement: walltime | |
| bench_target: walltime | |
| runner: '"physical-1-exclusive"' | |
| test-windows: | |
| name: Test Windows | |
| needs: [check-changed] | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' }} | |
| uses: ./.github/workflows/reusable-build.yml | |
| with: | |
| target: x86_64-pc-windows-msvc | |
| profile: 'ci' | |
| runner: ${{ vars.WINDOWS_SELF_HOSTED_RUNNER_LABELS || '"windows-latest"' }} | |
| test-runner: '"windows-latest"' | |
| test: true | |
| test-mac: | |
| name: Test Mac ARM64 | |
| needs: [check-changed] | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' }} | |
| uses: ./.github/workflows/reusable-build.yml | |
| with: | |
| target: aarch64-apple-darwin | |
| profile: 'ci' | |
| runner: ${{ vars.MAC_SELF_HOSTED_RUNNER_LABELS || '"macos-latest"' }} | |
| test-runner: ${{ '"macos-latest"' }} | |
| test: true | |
| build-wasm: | |
| name: Build WASM | |
| needs: [check-changed] | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' }} | |
| uses: ./.github/workflows/reusable-build-build.yml | |
| with: | |
| target: wasm32-wasip1-threads | |
| profile: 'ci' | |
| runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }} | |
| test-wasm: | |
| name: Test WASM | |
| needs: [check-changed, build-wasm] | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' }} | |
| uses: ./.github/workflows/reusable-build-test.yml | |
| with: | |
| target: wasm32-wasip1-threads | |
| runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }} | |
| check-cache: | |
| name: Check Cache Portable | |
| needs: [test-linux, test-windows] | |
| runs-on: ${{ fromJSON(vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - name: Install Rust Toolchain | |
| uses: ./.github/actions/rustup | |
| with: | |
| key: test_cache | |
| save-if: true | |
| - name: Download linux cache | |
| uses: ./.github/actions/artifact/download | |
| with: | |
| name: testCase-persistentCache-linux | |
| path: ./cache-linux | |
| force-use-github-only: true | |
| - name: Download windows cache | |
| uses: ./.github/actions/artifact/download | |
| with: | |
| name: testCase-persistentCache-windows | |
| path: ./cache-windows | |
| force-use-github-only: true | |
| - name: Run compare kit | |
| run: | | |
| echo "success" | |
| # TODO open it after rspack portable cache implementation | |
| # cargo run -p rspack_tools -- compare ./cache-linux ./cache-windows | |
| test_required_check: | |
| # this job will be used for GitHub actions to determine required job success or not; | |
| # When code changed, it will check if any of the test jobs failed. | |
| # When *only* doc changed, it will run as success directly | |
| name: Test Required Check | |
| needs: | |
| [ | |
| build-linux, | |
| test-linux, | |
| test-windows, | |
| test-mac, | |
| build-wasm, | |
| test-wasm, | |
| check-changed, | |
| size-limit, | |
| check-cache, | |
| ] | |
| if: ${{ always() && !cancelled() }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Log | |
| run: echo ${{ join(needs.*.result, ',') }} | |
| - name: Test check | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' | |
| && github.event_name == 'pull_request' | |
| && join(needs.*.result, ',')!='success,success,success,success,success,success,success,success,success' }} | |
| run: echo "Test Failed" && exit 1 | |
| - name: Test check | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' | |
| && github.event_name != 'pull_request' | |
| && join(needs.*.result, ',')!='success,success,success,success,success,success,success,skipped,success' }} | |
| run: echo "Test Failed" && exit 1 | |
| - name: No check to Run test | |
| run: echo "Success" | |
| size-limit: | |
| name: Binary Size Limit | |
| needs: [check-changed, build-linux] | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' && github.event_name == 'pull_request' }} | |
| uses: ./.github/workflows/size-limit.yml | |
| ecosystem_ci_per_commit: | |
| name: Run ecosystem CI per commit | |
| needs: [check-changed, build-linux] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| permissions: | |
| contents: write | |
| if: ${{ needs.check-changed.outputs.code_changed == 'true' && github.event_name == 'push' }} | |
| steps: | |
| - name: Trigger Ecosystem CI | |
| uses: rstackjs/rstack-ecosystem-ci/.github/actions/ecosystem_ci_per_commit@ca8d345a115158ea5ab3807378357f2162be7467 # v0.3.1 | |
| with: | |
| github-token: ${{ secrets.REPO_RSTACK_ECO_CI_GITHUB_TOKEN }} | |
| ecosystem-owner: web-infra-dev | |
| ecosystem-repo: rspack | |
| workflow-file: rspack-ecosystem-ci-from-commit.yml | |
| client-payload: '{"commitSHA":"${{ github.sha }}","updateComment":true,"repo":"web-infra-dev/rspack","suite":"-","suiteRefType":"precoded","suiteRef":"precoded","sourceRunId":"${{ github.run_id }}","sourceRepo":"web-infra-dev/rspack"}' | |
| # TODO: enable it after self hosted runners are ready | |
| # pkg-preview: | |
| # name: Pkg Preview | |
| # needs: | |
| # - test-linux | |
| # - test-windows | |
| # - cargo-deny | |
| # - lint | |
| # - rust_check | |
| # - rust_test | |
| # # after merged to main branch | |
| # if: ${{ !failure() && github.event_name == 'push' }} | |
| # uses: ./.github/workflows/preview-commit.yml |