From 85c0d6f6ff357f85256fbeb69f8fc343fd1a1641 Mon Sep 17 00:00:00 2001 From: SatoshiTerasaki Date: Wed, 8 Apr 2026 09:51:52 +0900 Subject: [PATCH 1/9] ci: add self-hosted PR workflow for same-repo pull requests Fork PRs use ubuntu-22.04 with full setup; same-repo PRs run tests on self-hosted runners (linux/x64/fast-ci) to offload heavy workloads. Made-with: Cursor --- .github/workflows/CI_rs_selfhost.yml | 62 ++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/CI_rs_selfhost.yml diff --git a/.github/workflows/CI_rs_selfhost.yml b/.github/workflows/CI_rs_selfhost.yml new file mode 100644 index 00000000..0bded4fc --- /dev/null +++ b/.github/workflows/CI_rs_selfhost.yml @@ -0,0 +1,62 @@ +name: CI + +on: + pull_request: + branches: [main] + +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@v4 + + - 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, fast-ci] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + # 必要に応じてセットアップを追加 + - uses: dtolnay/rust-toolchain@stable + + - uses: taiki-e/install-action@nextest + + - uses: Swatinem/rust-cache@v2 + - name: Run tests (non-HDF5) + run: cargo nextest run --release --workspace --exclude tensor4all-hdf5 From 9dee79f9969f7bedb5fbe4f3cc158efd2cc9b351 Mon Sep 17 00:00:00 2001 From: SatoshiTerasaki Date: Wed, 8 Apr 2026 10:02:59 +0900 Subject: [PATCH 2/9] Do not cache --- .github/workflows/CI_rs_selfhost.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI_rs_selfhost.yml b/.github/workflows/CI_rs_selfhost.yml index 0bded4fc..8151f098 100644 --- a/.github/workflows/CI_rs_selfhost.yml +++ b/.github/workflows/CI_rs_selfhost.yml @@ -22,7 +22,7 @@ jobs: # target artifacts small enough to avoid runner disk exhaustion on cache misses. CARGO_PROFILE_RELEASE_DEBUG: 0 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install HDF5 run: sudo apt-get update && sudo apt-get install -y libhdf5-dev @@ -50,13 +50,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 # 必要に応じてセットアップを追加 - uses: dtolnay/rust-toolchain@stable - uses: taiki-e/install-action@nextest - - uses: Swatinem/rust-cache@v2 - name: Run tests (non-HDF5) run: cargo nextest run --release --workspace --exclude tensor4all-hdf5 From 3f2925a681e3ca94cdb051e10843a418dcfc86ab Mon Sep 17 00:00:00 2001 From: SatoshiTerasaki Date: Wed, 8 Apr 2026 10:21:29 +0900 Subject: [PATCH 3/9] ci: update self-hosted CI workflow with environment variables Added CARGO_TARGET_DIR and CARGO_PROFILE_RELEASE_DEBUG to the self-hosted CI workflow for improved build configuration. Included a step to display the target directory during the CI process. --- .github/workflows/CI_rs_selfhost.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI_rs_selfhost.yml b/.github/workflows/CI_rs_selfhost.yml index 8151f098..a3ddb066 100644 --- a/.github/workflows/CI_rs_selfhost.yml +++ b/.github/workflows/CI_rs_selfhost.yml @@ -47,7 +47,9 @@ jobs: 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, fast-ci] - + env: + CARGO_TARGET_DIR: /var/cache/tensor4all/tensor4all-rs/target + CARGO_PROFILE_RELEASE_DEBUG: 0 steps: - name: Checkout uses: actions/checkout@v6 @@ -56,6 +58,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable - uses: taiki-e/install-action@nextest - + - name: Show target dir + run: echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR" - name: Run tests (non-HDF5) run: cargo nextest run --release --workspace --exclude tensor4all-hdf5 From 2ed23dab073fb76ed17f82f2603e6d904032a9d7 Mon Sep 17 00:00:00 2001 From: SatoshiTerasaki Date: Wed, 8 Apr 2026 10:27:16 +0900 Subject: [PATCH 4/9] ci: modify CARGO_TARGET_DIR in self-hosted CI workflow Updated the CARGO_TARGET_DIR environment variable in the self-hosted CI workflow to use a relative path based on the GitHub workspace, improving build directory management. --- .github/workflows/CI_rs_selfhost.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI_rs_selfhost.yml b/.github/workflows/CI_rs_selfhost.yml index a3ddb066..b2c47dec 100644 --- a/.github/workflows/CI_rs_selfhost.yml +++ b/.github/workflows/CI_rs_selfhost.yml @@ -48,7 +48,7 @@ jobs: if: github.event.pull_request.head.repo.full_name == github.repository runs-on: [self-hosted, linux, x64, fast-ci] env: - CARGO_TARGET_DIR: /var/cache/tensor4all/tensor4all-rs/target + CARGO_TARGET_DIR: ${{ github.workspace }}/../../target CARGO_PROFILE_RELEASE_DEBUG: 0 steps: - name: Checkout From 230a281c42e9cd6c020dc6085b1f9991d1391f47 Mon Sep 17 00:00:00 2001 From: SatoshiTerasaki Date: Wed, 8 Apr 2026 10:29:40 +0900 Subject: [PATCH 5/9] adjust cargo target dir --- .github/workflows/CI_rs_selfhost.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI_rs_selfhost.yml b/.github/workflows/CI_rs_selfhost.yml index b2c47dec..d45c3a9d 100644 --- a/.github/workflows/CI_rs_selfhost.yml +++ b/.github/workflows/CI_rs_selfhost.yml @@ -48,7 +48,7 @@ jobs: if: github.event.pull_request.head.repo.full_name == github.repository runs-on: [self-hosted, linux, x64, fast-ci] env: - CARGO_TARGET_DIR: ${{ github.workspace }}/../../target + CARGO_TARGET_DIR: ${{ github.workspace }}/../target CARGO_PROFILE_RELEASE_DEBUG: 0 steps: - name: Checkout From 07796dff8636296aaf48875ebe4a4d1281553fd3 Mon Sep 17 00:00:00 2001 From: SatoshiTerasaki Date: Wed, 8 Apr 2026 10:32:54 +0900 Subject: [PATCH 6/9] fix: update CI_rs_selfhost.yml to use correct target directory --- .github/workflows/CI_rs_selfhost.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI_rs_selfhost.yml b/.github/workflows/CI_rs_selfhost.yml index d45c3a9d..2bb205f1 100644 --- a/.github/workflows/CI_rs_selfhost.yml +++ b/.github/workflows/CI_rs_selfhost.yml @@ -58,7 +58,6 @@ jobs: - uses: dtolnay/rust-toolchain@stable - uses: taiki-e/install-action@nextest - - name: Show target dir - run: echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR" + - name: Run tests (non-HDF5) run: cargo nextest run --release --workspace --exclude tensor4all-hdf5 From 5fbd2e7ca99278e5e8a305f778c2ef5ad494575d Mon Sep 17 00:00:00 2001 From: SatoshiTerasaki Date: Wed, 8 Apr 2026 10:43:54 +0900 Subject: [PATCH 7/9] ci: rename CI workflow and add HDF5 test step Updated the CI workflow name to 'CI_rs_selfhost' and added a new step to run HDF5 tests, enhancing the testing coverage for the project. --- .github/workflows/CI_rs_selfhost.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI_rs_selfhost.yml b/.github/workflows/CI_rs_selfhost.yml index 2bb205f1..807df00e 100644 --- a/.github/workflows/CI_rs_selfhost.yml +++ b/.github/workflows/CI_rs_selfhost.yml @@ -1,4 +1,4 @@ -name: CI +name: CI_rs_selfhost on: pull_request: @@ -61,3 +61,6 @@ jobs: - 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 From 0b60858118caf1414230fd9ea3db2bc7567aff57 Mon Sep 17 00:00:00 2001 From: SatoshiTerasaki Date: Wed, 8 Apr 2026 10:48:20 +0900 Subject: [PATCH 8/9] ci: disable test job in CI workflow Commented out the entire test job in the CI workflow to streamline the process, potentially for debugging or reconfiguration purposes. --- .github/workflows/CI_rs.yml | 55 +++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/.github/workflows/CI_rs.yml b/.github/workflows/CI_rs.yml index 136d0fec..9a4f7fc6 100644 --- a/.github/workflows/CI_rs.yml +++ b/.github/workflows/CI_rs.yml @@ -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 - - - 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 + # testジョブ全体を無効化 + # 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 + + # - 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 coverage: name: Coverage From e6dc424297d860b0677c04724ee0d364b101ce8d Mon Sep 17 00:00:00 2001 From: SatoshiTerasaki Date: Wed, 8 Apr 2026 10:50:33 +0900 Subject: [PATCH 9/9] Minor fix --- .github/workflows/CI_rs.yml | 2 +- .github/workflows/CI_rs_selfhost.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI_rs.yml b/.github/workflows/CI_rs.yml index 9a4f7fc6..662ca621 100644 --- a/.github/workflows/CI_rs.yml +++ b/.github/workflows/CI_rs.yml @@ -87,7 +87,7 @@ jobs: runs-on: ubuntu-latest needs: - lint - - test + #- test - coverage if: always() steps: diff --git a/.github/workflows/CI_rs_selfhost.yml b/.github/workflows/CI_rs_selfhost.yml index 807df00e..8eb01e01 100644 --- a/.github/workflows/CI_rs_selfhost.yml +++ b/.github/workflows/CI_rs_selfhost.yml @@ -46,7 +46,7 @@ jobs: 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, fast-ci] + runs-on: [self-hosted, linux, x64] env: CARGO_TARGET_DIR: ${{ github.workspace }}/../target CARGO_PROFILE_RELEASE_DEBUG: 0