Skip to content

Commit 23be9f4

Browse files
committed
modified:
1 parent 3dc5e9e commit 23be9f4

File tree

2 files changed

+26
-35
lines changed

2 files changed

+26
-35
lines changed

.github/workflows/csubst-smoke.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: [ubuntu-latest, macos-latest]
21-
python: ['3.10'] # ← 3.10 に統一
22-
install: [source]
21+
python: ['3.10']
22+
install: [source] # bioconda は後で復活可
2323

2424
steps:
2525
- name: Checkout
@@ -29,7 +29,6 @@ jobs:
2929
uses: mamba-org/setup-micromamba@v1
3030
with:
3131
environment-name: csubst-smoke
32-
# まずは軽い環境(Python+pip)だけ作る
3332
create-args: >-
3433
python=${{ matrix.python }}
3534
pip
@@ -41,38 +40,34 @@ jobs:
4140
cache-environment: true
4241
cache-downloads: true
4342

44-
# 共通の実行時依存は conda でピン留め(NumPy 1.26 / Cython 0.29)
45-
- name: Install runtime deps (common)
43+
- name: Install runtime deps
4644
shell: bash -l {0}
4745
run: |
4846
micromamba install -y numpy=1.26.* cython=0.29.* iqtree
4947
50-
# ---- source ビルド ----
5148
- name: Install csubst (from source)
5249
if: matrix.install == 'source'
5350
shell: bash -l {0}
5451
run: |
5552
python -m pip install --upgrade pip
56-
# 環境内の numpy/cython を使わせる
5753
pip install --no-build-isolation .
5854
59-
# ---- bioconda ----
60-
- name: Install csubst (from Bioconda)
61-
if: matrix.install == 'bioconda'
55+
# --- Smoke ---
56+
- name: Run smoke test
6257
shell: bash -l {0}
63-
run: |
64-
micromamba install -y csubst
58+
run: bash ci/csubst_smoke.sh
6559

66-
- name: Run smoke test
60+
# --- CLI tests ---
61+
- name: Run CLI tests
6762
shell: bash -l {0}
68-
run: |
69-
bash ci/csubst_smoke.sh
63+
run: bash ci/csubst_cli.sh
7064

71-
- name: Upload smoke logs (always)
65+
- name: Upload artifacts (always)
7266
if: always()
7367
uses: actions/upload-artifact@v4
7468
with:
75-
name: smoke-logs-${{ matrix.os }}-${{ matrix.install }}
76-
path: $RUNNER_TEMP/csubst_smoke/_artifacts
69+
name: smoke-and-cli-${{ matrix.os }}-${{ matrix.install }}
70+
path: |
71+
$RUNNER_TEMP/csubst_smoke/_artifacts*
7772
if-no-files-found: ignore
7873
retention-days: 7

ci/csubst_cli.sh

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,35 @@ echo "== csubst CLI tests =="
66
which csubst
77
csubst --version || true
88

9-
# --- ヘルプが期待どおり出るか(主要サブコマンドと必須引数名) ---
9+
# --- ヘルプ(主要サブコマンド/引数の存在) ---
1010
csubst -h | head -n 20
1111
csubst -h | grep -E '\banalyze\b' >/dev/null
1212
csubst -h | grep -E '\bdataset\b' >/dev/null
1313
csubst analyze -h | grep -- '--alignment_file' >/dev/null
1414
csubst analyze -h | grep -- '--rooted_tree_file' >/dev/null
1515
csubst analyze -h | grep -- '--foreground' >/dev/null
1616

17-
# 作業ディレクトリ(smoke と同じ場所を再利用
17+
# 作業ディレクトリ(smoke と共用
1818
WORKDIR="${RUNNER_TEMP:-$(mktemp -d)}/csubst_smoke"
1919
mkdir -p "$WORKDIR"
2020
cd "$WORKDIR"
2121

22-
# 必要なら最小データを用意
22+
# 最小データが無ければ生成
2323
if [ ! -s alignment.fa ]; then
2424
csubst dataset --name PGK
2525
fi
2626
test -s alignment.fa && test -s tree.nwk && test -s foreground.txt
2727

28-
# --- 異常系:存在しない入力で失敗すべき ---
28+
# --- 異常系:欠損入力で失敗すること ---
2929
set +e
3030
csubst analyze --alignment_file __NO_FILE__.fa \
3131
--rooted_tree_file tree.nwk --foreground foreground.txt --threads 1 >/dev/null 2>&1
3232
rc=$?
3333
set -e
34-
if [ $rc -eq 0 ]; then
35-
echo "ERROR: 存在しない入力で analyze が成功してしまいました"; exit 1
36-
else
37-
echo "OK: 異常系(欠損入力)は非0で失敗"
38-
fi
34+
[ $rc -ne 0 ] || { echo "ERROR: 欠損入力で成功してしまった"; exit 1; }
35+
echo "OK: 異常系で非0終了を確認"
3936

40-
# --- 正常系(1):既定モデル(ECM系 ---
37+
# --- 正常系(ECM系:デフォルト) ---
4138
rm -f alignment.fa.{iqtree,log,rate,state,treefile} || true
4239
env PYTHONOPTIMIZE=1 OMP_NUM_THREADS=1 csubst analyze \
4340
--alignment_file alignment.fa \
@@ -47,23 +44,22 @@ env PYTHONOPTIMIZE=1 OMP_NUM_THREADS=1 csubst analyze \
4744

4845
shopt -s nullglob
4946
CB1=(csubst_cb_*.tsv)
50-
[ ${#CB1[@]} -ge 1 ] || { echo "ERROR: ECM 実行後に cb TSV がありません"; exit 1; }
51-
[ $(wc -l < "${CB1[0]}") -ge 2 ] || { echo "ERROR: cb TSV が空のようです"; exit 1; }
52-
grep $'\t' "${CB1[0]}" >/dev/null || { echo "ERROR: cb TSV がタブ区切りでない可能性"; exit 1; }
47+
[ ${#CB1[@]} -ge 1 ] || { echo "ERROR: ECM 実行後に cb TSV が無い"; exit 1; }
48+
[ $(wc -l < "${CB1[0]}") -ge 2 ] || { echo "ERROR: cb TSV が空"; exit 1; }
49+
grep $'\t' "${CB1[0]}" >/dev/null || { echo "ERROR: TSV がタブ区切りでない可能性"; exit 1; }
5350

54-
# --- 正常系(2):GY+F3x4+R2(別分岐も生存確認) ---
51+
# --- 正常系(GY系:別分岐) ---
5552
rm -f alignment.fa.{iqtree,log,rate,state,treefile} || true
5653
env PYTHONOPTIMIZE=1 OMP_NUM_THREADS=1 csubst analyze \
5754
--alignment_file alignment.fa \
5855
--rooted_tree_file tree.nwk \
5956
--foreground foreground.txt \
6057
--iqtree_model GY+F3x4+R2 \
6158
--threads 1
62-
6359
CB2=(csubst_cb_*.tsv)
64-
[ ${#CB2[@]} -ge 1 ] || { echo "ERROR: GY 実行後に cb TSV がありません"; exit 1; }
60+
[ ${#CB2[@]} -ge 1 ] || { echo "ERROR: GY 実行後に cb TSV が無い"; exit 1; }
6561

66-
# アーティファクト収集
62+
# アーティファクト収集(任意)
6763
ART="$WORKDIR/_artifacts_cli"
6864
mkdir -p "$ART"
6965
cp -v csubst_cb_*.tsv "$ART" 2>/dev/null || true

0 commit comments

Comments
 (0)