chore(deps): update npm dev dependencies #8426
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
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] | |
paths-ignore: | |
- "**/*.md" | |
- '!.github/workflows/ci.yml' | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "**/*.md" | |
- '!.github/workflows/ci.yml' | |
tags-ignore: | |
- "**" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: ${{ github.ref_name != 'main' }} | |
jobs: | |
get-runner-labels: | |
name: Get Runner Labels | |
uses: ./.github/workflows/get-runner-labels.yml | |
test-linux: | |
name: Test Linux | |
needs: [get-runner-labels] | |
uses: ./.github/workflows/reusable-build.yml | |
with: | |
target: x86_64-unknown-linux-gnu | |
profile: "debug" | |
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }} | |
test-diff: true | |
test-release-linux: | |
name: Test Release Linux | |
needs: [get-runner-labels] | |
if: contains(github.event.pull_request.title, '!linux') | |
uses: ./.github/workflows/reusable-build.yml | |
strategy: | |
fail-fast: false # Build and test everything so we can look at all the errors | |
matrix: | |
array: | |
- target: x86_64-unknown-linux-gnu | |
- target: aarch64-unknown-linux-gnu | |
- target: x86_64-unknown-linux-musl | |
- target: aarch64-unknown-linux-musl | |
with: | |
target: ${{ matrix.array.target }} | |
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }} | |
test-windows: | |
name: Test Windows | |
needs: [get-runner-labels] | |
uses: ./.github/workflows/reusable-build.yml | |
with: | |
target: x86_64-pc-windows-msvc | |
profile: "debug" | |
runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }} | |
test-diff: true | |
test-release-windows: | |
name: Test Release Windows | |
needs: [get-runner-labels] | |
if: contains(github.event.pull_request.title, '!windows') | |
uses: ./.github/workflows/reusable-build.yml | |
strategy: | |
fail-fast: false # Build and test everything so we can look at all the errors | |
matrix: | |
array: | |
- target: i686-pc-windows-msvc | |
- target: x86_64-pc-windows-msvc | |
- target: aarch64-pc-windows-msvc | |
with: | |
target: ${{ matrix.array.target }} | |
runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }} | |
test-mac: | |
name: Test Mac | |
needs: [get-runner-labels] | |
if: github.ref_name == 'main' || contains(github.event.pull_request.title, '!macos') | |
uses: ./.github/workflows/reusable-build.yml | |
with: | |
target: x86_64-apple-darwin | |
profile: "debug" | |
runner: ${{ needs.get-runner-labels.outputs.MACOS_RUNNER_LABELS }} | |
test-diff: true | |
test-release-mac: | |
name: Test Release Mac | |
needs: [get-runner-labels] | |
if: contains(github.event.pull_request.title, '!macos') | |
uses: ./.github/workflows/reusable-build.yml | |
strategy: | |
fail-fast: false # Build and test everything so we can look at all the errors | |
matrix: | |
array: | |
- target: x86_64-apple-darwin | |
- target: aarch64-apple-darwin | |
with: | |
target: ${{ matrix.array.target }} | |
runner: ${{ needs.get-runner-labels.outputs.MACOS_RUNNER_LABELS }} | |
cargo-deny: | |
name: Check license of dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
src: | |
- 'Cargo.lock' | |
- name: Install cargo-deny | |
if: steps.filter.outputs.src == 'true' | |
uses: taiki-e/install-action@cargo-deny | |
- name: Check licenses | |
if: steps.filter.outputs.src == 'true' | |
run: cargo deny check license | |
spell: | |
name: Spell check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: crate-ci/typos@master | |
with: | |
files: . | |
oxlint: | |
name: Lint JS | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: | | |
src: | |
- pnpm-lock.yaml | |
- '**/*.{ts,js,mjs,tsx,jsx}' | |
- name: Pnpm Cache | |
if: steps.changes.outputs.src == 'true' | |
uses: ./.github/actions/pnpm-cache | |
- name: oxlint | |
if: steps.changes.outputs.src == 'true' | |
run: pnpm run lint:js | |
rust_changes: | |
name: Rust Changes | |
runs-on: ubuntu-latest | |
outputs: | |
changed: ${{ steps.filter.outputs.changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
changed: | |
- '.github/workflows/ci.yml' | |
- 'crates/**' | |
- 'Cargo.lock' | |
- 'Cargo.toml' | |
- 'rust-toolchain.toml' | |
pnpm_lockfile_check: | |
name: Pnpm Lockfile Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pnpm Cache # Required by some tests | |
uses: ./.github/actions/pnpm-cache | |
with: | |
frozen-lockfile: true | |
rust_check: | |
name: Rust check | |
needs: [get-runner-labels, rust_changes] | |
if: ${{ needs.rust_changes.outputs.changed == 'true' }} | |
runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust Toolchain | |
uses: ./.github/actions/rustup | |
with: | |
clippy: true | |
fmt: true | |
shared-key: check | |
- name: Run Cargo Check | |
run: cargo check --workspace --all-targets --locked # Not using --release because it uses too much cache, and is also slow. | |
- name: Run Clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --workspace --all-targets -- -D warnings | |
- name: Run rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
rust_unused_dependencies: | |
name: Check Rust Unused Dependencies | |
needs: [get-runner-labels, rust_changes] | |
if: ${{ needs.rust_changes.outputs.changed == 'true' }} | |
runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
src: | |
- 'Cargo.toml' | |
- '**/Cargo.toml' | |
- name: Install cargo-machete | |
if: steps.filter.outputs.src == 'true' | |
uses: taiki-e/install-action@cargo-machete | |
- name: Install Rust Toolchain | |
uses: ./.github/actions/rustup | |
with: | |
shared-key: check | |
- if: steps.filter.outputs.src == 'true' | |
run: cargo machete | |
rust_test: | |
name: Rust test | |
needs: [get-runner-labels, rust_changes] | |
if: ${{ needs.rust_changes.outputs.changed == 'true' }} | |
runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pnpm Cache # Required by some tests | |
uses: ./.github/actions/pnpm-cache | |
- name: Install Rust Toolchain | |
uses: ./.github/actions/rustup | |
with: | |
save-cache: ${{ github.ref_name == 'main' }} | |
shared-key: check | |
# Compile test without debug info for reducing the CI cache size | |
- name: Change profile.test | |
shell: bash | |
run: | | |
echo '[profile.test]' >> Cargo.toml | |
echo 'debug = false' >> Cargo.toml | |
- name: Run test | |
run: cargo test --workspace -- --nocapture | |
run_benchmark: | |
name: Run benchmark | |
runs-on: ubuntu-latest | |
if: github.ref_name == 'main' && github.repository_owner == 'web-infra-dev' | |
steps: | |
- name: Run Benchmark | |
uses: convictional/trigger-workflow-and-wait@v1.6.5 | |
with: | |
owner: ${{ github.repository_owner }} | |
repo: 'rspack-ecosystem-benchmark' | |
workflow_file_name: 'bench_rspack_commit.yml' | |
github_token: ${{ secrets.RSPACK_BOT_ACCESS_TOKEN }} | |
ref: 'main' | |
client_payload: '{"commit_sha":"${{ github.sha }}"}' | |
run_ecosystem_ci: | |
name: Run Ecosystem CI | |
runs-on: ubuntu-latest | |
if: github.ref_name == 'main' && github.repository_owner == 'web-infra-dev' | |
steps: | |
- name: Run Ecosystem CI | |
uses: convictional/trigger-workflow-and-wait@v1.6.5 | |
with: | |
owner: ${{ github.repository_owner }} | |
repo: 'rspack-ecosystem-ci' | |
workflow_file_name: 'ecosystem-ci-from-commit.yml' | |
github_token: ${{ secrets.ECOSYSTEM_CI_ACCESS_TOKEN }} | |
ref: 'main' | |
client_payload: '{"commitSHA":"${{ github.sha }}","repo":"web-infra-dev/rspack","suite":"-","suiteRefType":"precoded","suiteRef":"precoded"}' | |
failure_notification: | |
name: Failure Notification | |
needs: [test-linux, test-windows, test-mac, rust_check, rust_test, run_benchmark, run_ecosystem_ci] | |
if: ${{ failure() && !cancelled() && github.ref_name == 'main' && github.repository_owner == 'web-infra-dev' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- shell: bash | |
run: ./scripts/alert/lark.js | |
env: | |
TITLE: CI failed on main branch | |
DESCRIPTION: | | |
commitID: [${{github.sha}}](${{github.server_url}}/${{github.repository}}/commit/${{github.sha}}) | |
URL: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}} | |
LARK_WEBHOOK_URL: ${{secrets.LARK_WEBHOOK_URL}} |