name: CI Test # 可复用工作流:主 ci.yml 的 test job 经 workflow_call 调用本文件。外观上主 CI # 只有一个 test job(全过才绿),点进去才看到内部 matrix(os × group)并行图。 # 产物复用:test 依赖主 workflow 的 build job 先把 workspace 编译一遍并写入 # sccache(GitHub Actions 缓存后端),各分区随后经 sccache 命中已编产物,只补编 # 自己的 test harness;rust-cache 负责依赖源码与 registry 的缓存。 on: workflow_call: env: # 与主 ci.yml 一致:sccache 走 GitHub Actions 缓存后端,编译产物跨 run 复用。 SCCACHE_GHA_ENABLED: "true" jobs: test: name: Test (${{ matrix.os }} / ${{ matrix.group.name }}) strategy: fail-fast: false matrix: # os 列表静态:960 跨平台时手改加 windows-latest 与 macos-latest。在生成段 # 之外,钩子重生成 group 条目时不会覆盖它。 os: [ubuntu-latest] group: # === AUTO-GENERATED: group 条目(gen_ci_test_jobs.sh 生成,勿手改)=== - name: oxide_builtins-1 args: "-p oxide_builtins --partition count:1/2" - name: oxide_builtins-2 args: "-p oxide_builtins --partition count:2/2" - name: oxide_vm-1 args: "-p oxide_vm --partition count:1/2" - name: oxide_vm-2 args: "-p oxide_vm --partition count: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" # === END AUTO-GENERATED === runs-on: ${{ matrix.os }} timeout-minutes: 40 steps: - uses: actions/checkout@v7 with: submodules: true - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: # 与 ci.yml build job 同名后缀的稳定键;rust-cache 自动键附 job 名, # 故与 build 仍是两份独立缓存,跨 job 的 workspace 产物复用由 sccache # 承担(见本文件头注释)。 key: oxide-target-ubuntu-v1 - uses: ./.github/actions/setup-tools - name: Test run: cargo nextest run ${{ matrix.group.args }}