From 88ec92c72df2e37cba24affd4f1822db317b2e09 Mon Sep 17 00:00:00 2001 From: pjh456 <147148383@qq.com> Date: Sat, 10 Oct 2026 10:52:01 +0000 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B5=8B=E8=AF=95=E6=8B=86=E5=8F=AF?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=20matrix=20=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E5=8A=A0=E6=8C=89=E5=88=86=E5=B8=83=E8=87=AA=E5=8A=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-test.yml | 48 +++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 17 +++---------- 2 files changed, 52 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/ci-test.yml diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml new file mode 100644 index 00000000..6fa74a0b --- /dev/null +++ b/.github/workflows/ci-test.yml @@ -0,0 +1,48 @@ +name: CI Test + +# 可复用工作流:主 ci.yml 的 test job 经 workflow_call 调用本文件。外观上主 CI +# 只有一个 test job(全过才绿),点进去才看到内部 matrix(os × group)并行图。 +# 产物复用:rust-cache 按「OS + Cargo.lock」键在仓库级共享,本 workflow 的 test +# job 能 restore 主 ci.yml build job 存的 target/ 缓存(跨 workflow 边界有效)。 +on: + workflow_call: + +jobs: +# === AUTO-GENERATED: CI test jobs(gen_ci_test_jobs.sh 生成,勿手改)=== + test: + name: Test (${{ matrix.os }} / ${{ matrix.group.name }}) + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] # 960 跨平台完成后加 windows-latest 与 macos-latest + group: + - name: oxide_builtins-1 + args: "-p oxide_builtins --partition 2/1" + - name: oxide_builtins-2 + args: "-p oxide_builtins --partition 2/2" + - name: oxide_vm-1 + args: "-p oxide_vm --partition 2/1" + - name: oxide_vm-2 + args: "-p oxide_vm --partition 2/2" + - name: oxide_cli + args: "-p oxide_cli" + - name: oxide_types + args: "-p oxide_types" + - name: light-1 + args: "-p oxide_test262 -p oxide_emit -p oxide_dce -p oxide_liveness -p oxide_runtime_api" + - name: light-2 + args: "-p oxide_kernel -p oxide_regalloc -p oxide_cfg -p oxide_bytecode -p oxide_engine -p oxide_compiler -p oxide_parser -p oxide_log -p oxide_ir -p oxide_code_cache" + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Install sccache and mold + run: sudo apt-get update -y && sudo apt-get install -y sccache mold + - name: Install cargo-nextest + run: curl -sSf https://raw.githubusercontent.com/nextest-rs/nextest/main/scripts/install.sh | bash + - name: Test + run: cargo nextest run ${{ matrix.group.args }} +# === END AUTO-GENERATED === diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7eadf46b..e3488d1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,19 +60,10 @@ jobs: - name: Build run: cargo build --verbose + # test 是单一 job:经 workflow_call 调用 ci-test.yml,外观上主 CI 只有一个 test + # (全过才绿),点进去才见内部 matrix(os × group)并行图。needs build 复用产物。 test: name: Test - # 依赖 build:等 build 编译完成后才启动,经共享 rust-cache 复用 build 的 - # target/ 产物(同缓存键 = OS + Cargo.lock),cargo test 只补编 test harness。 needs: [build] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - name: Install sccache and mold - run: sudo apt-get update -y && sudo apt-get install -y sccache mold - - name: Test - run: cargo test --verbose + uses: ./.github/workflows/ci-test.yml + secrets: inherit