Skip to content

fix(rstest): hoist importActual ESM imports #32875

fix(rstest): hoist importActual ESM imports

fix(rstest): hoist importActual ESM imports #32875

Workflow file for this run

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: ubuntu-latest
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@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: filter
with:
predicate-quantifier: 'every'
filters: |
code_changed:
- "!**/*.md"
- "!**/*.mdx"
- "!website/**"
document_changed:
- "website/**"
test-linux:
name: Test Linux
needs: [check-changed]
if: ${{ needs.check-changed.outputs.code_changed == 'true' }}
uses: ./.github/workflows/reusable-build.yml
with:
target: x86_64-unknown-linux-gnu
profile: 'ci'
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
test: true
bench: true
prefer_docker: false
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: 'dev'
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
test-wasm:
name: Test WASM
needs: [check-changed]
if: ${{ needs.check-changed.outputs.code_changed == 'true' }}
uses: ./.github/workflows/reusable-build.yml
with:
target: wasm32-wasip1-threads
profile: 'ci'
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
test: true
check-codspeed:
name: Check Bench Result
needs: [test-linux]
runs-on: ubuntu-24.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Polling Comment
if: ${{ github.event_name == 'pull_request' }}
run: bash .github/actions/codspeed/check-comment.sh
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@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- 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: true
- name: Download windows cache
uses: ./.github/actions/artifact/download
with:
name: testCase-persistentCache-windows
path: ./cache-windows
force-use-github: 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:
[
check-codspeed,
test-linux,
test-windows,
test-mac,
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' }}
run: echo "Tess 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,skipped,success' }}
run: echo "Tess Failed" && exit 1
- name: No check to Run test
run: echo "Success"
size-limit:
name: Binary Size Limit
needs: [check-changed]
if: ${{ needs.check-changed.outputs.code_changed == 'true' && github.event_name == 'pull_request' }}
uses: ./.github/workflows/size-limit.yml
# 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