Skip to content

ci: add self-hosted PR workflow for same-repo pull requests #5

ci: add self-hosted PR workflow for same-repo pull requests

ci: add self-hosted PR workflow for same-repo pull requests #5

Workflow file for this run

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@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, fast-ci]
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: 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