Skip to content
45 changes: 23 additions & 22 deletions .github/workflows/CI_rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,34 @@ jobs:
- name: Run clippy
run: cargo clippy --workspace --all-targets -- -D warnings

test:
name: Test
runs-on: ubuntu-22.04
env:
# CI release tests don't need DWARF debug info, and disabling it keeps
# target artifacts small enough to avoid runner disk exhaustion on cache misses.
CARGO_PROFILE_RELEASE_DEBUG: 0
steps:
- uses: actions/checkout@v4
# testジョブ全体を無効化
# test:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore release test job coverage outside main PRs

Commenting out the test job here removes release/tensor4all-hdf5 test execution from CI_rs.yml, but the replacement workflow only triggers for pull_request to main (CI_rs_selfhost.yml), so PRs targeting develop and all push runs no longer get the previous test coverage. That creates a real gap where regressions can pass CI undetected in those paths.

Useful? React with 👍 / 👎.

# name: Test
# runs-on: ubuntu-22.04
# env:
# # CI release tests don't need DWARF debug info, and disabling it keeps
# # target artifacts small enough to avoid runner disk exhaustion on cache misses.
# CARGO_PROFILE_RELEASE_DEBUG: 0
# steps:
# - uses: actions/checkout@v4

- name: Install HDF5
run: sudo apt-get update && sudo apt-get install -y libhdf5-dev
# - name: Install HDF5
# run: sudo apt-get update && sudo apt-get install -y libhdf5-dev

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
# - name: Install Rust
# uses: dtolnay/rust-toolchain@stable

- uses: taiki-e/install-action@nextest
# - uses: taiki-e/install-action@nextest

- uses: Swatinem/rust-cache@v2
# - uses: Swatinem/rust-cache@v2

# tensor4all-hdf5 is kept out of nextest because its dlopen-based tests
# fail under nextest's per-process execution model.
- name: Run tests (non-HDF5)
run: cargo nextest run --release --workspace --exclude tensor4all-hdf5
# # tensor4all-hdf5 is kept out of nextest because its dlopen-based tests
# # fail under nextest's per-process execution model.
# - name: Run tests (non-HDF5)
# run: cargo nextest run --release --workspace --exclude tensor4all-hdf5

- name: Run HDF5 tests
run: cargo test --release -p tensor4all-hdf5
# - name: Run HDF5 tests
# run: cargo test --release -p tensor4all-hdf5

coverage:
name: Coverage
Expand All @@ -86,7 +87,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- lint
- test
#- test
- coverage
if: always()
steps:
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/CI_rs_selfhost.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI_rs_selfhost

on:
pull_request:
branches: [main]
Comment on lines +3 to +5
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid running duplicate PR test pipelines

This workflow triggers on every pull_request to main, but CI_rs.yml already does the same (pull_request on main/develop), so each PR to main now runs two near-identical Rust test pipelines in parallel (fork PRs: CI_rs test + ci-fork; same-repo PRs: CI_rs test + ci-maintainer). That doubles CI load and queue time, and can starve self-hosted capacity without adding new validation coverage.

Useful? React with 👍 / 👎.


permissions:
contents: read

concurrency:
group: ci-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
# fork からの PR: GitHub-hosted runner で通常 CI
ci-fork:
name: CI (fork PR / github-hosted)
if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-22.04
env:
# CI release tests don't need DWARF debug info, and disabling it keeps
# target artifacts small enough to avoid runner disk exhaustion on cache misses.
CARGO_PROFILE_RELEASE_DEBUG: 0
steps:
- uses: actions/checkout@v6

- name: Install HDF5
run: sudo apt-get update && sudo apt-get install -y libhdf5-dev

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- uses: taiki-e/install-action@nextest

- uses: Swatinem/rust-cache@v2

# tensor4all-hdf5 is kept out of nextest because its dlopen-based tests
# fail under nextest's per-process execution model.
- name: Run tests (non-HDF5)
run: cargo nextest run --release --workspace --exclude tensor4all-hdf5

- name: Run HDF5 tests
run: cargo test --release -p tensor4all-hdf5

# PRs from the same repository: run heavy CI on self-hosted runner
ci-maintainer:
name: CI (same-repo PR / self-hosted heavy)
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: [self-hosted, linux, x64]
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/../target
CARGO_PROFILE_RELEASE_DEBUG: 0
steps:
- name: Checkout
uses: actions/checkout@v6

# 必要に応じてセットアップを追加
- uses: dtolnay/rust-toolchain@stable

- uses: taiki-e/install-action@nextest

- name: Run tests (non-HDF5)
run: cargo nextest run --release --workspace --exclude tensor4all-hdf5
Comment on lines +62 to +63
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add HDF5 test step to same-repo job

The ci-maintainer path only runs cargo nextest ... --exclude tensor4all-hdf5 and never runs a replacement cargo test -p tensor4all-hdf5, unlike the fork path in the same workflow. As a result, same-repo PRs validated by this workflow can merge with regressions in tensor4all-hdf5 undetected.

Useful? React with 👍 / 👎.


- name: Run HDF5 tests
run: cargo test --release -p tensor4all-hdf5
Loading