前提: リポジトリを checkout 済み(actions/checkout)
jq は ubuntu-latest に標準で入っています
# .github/workflows/ci.yml などの steps: の中に追加する断片
# 前提: リポジトリを checkout 済み(actions/checkout)
# jq は ubuntu-latest に標準で入っています
- name: Regression (detail/rank) + Contract check (v0.1)
shell: bash
run: |
set -euo pipefail
cd decikg
# 1) detail 回帰(固定ワンライナー)
python -m decikg.graph_query.run_jsonl \
--in ./requests_opportunity_detail_gold3.jsonl \
--out /tmp/responses_detail.check.jsonl \
--progress --log-level INFO \
2>&1 | tee /tmp/run_detail.check.log
# 2) rank 回帰(固定ワンライナー)
python -m decikg.graph_query.run_jsonl \
--in ./requests_opportunity_pipeline.FIX.jsonl \
--out /tmp/responses_rank.check.jsonl \
--progress --log-level INFO \
2>&1 | tee /tmp/run_rank.check.log
# 3) 契約チェック(jq だけ)
./scripts/contract_check.sh \
/tmp/responses_detail.check.jsonl \
/tmp/responses_rank.check.jsonl \
2>&1 | tee /tmp/run_contract_check.log
- name: Upload regression artifacts (logs + responses)
if: always()
uses: actions/upload-artifact@v4
with:
name: graph-query-regression-artifacts
path: |
/tmp/run_detail.check.log
/tmp/run_rank.check.log
/tmp/run_contract_check.log
/tmp/responses_detail.check.jsonl
/tmp/responses_rank.check.jsonl
入れる場所は GitHub Actions の workflow ファイル(例:.github/workflows/ci.yml)の jobs.<job>.steps の中です。
つまり actions/checkout と Python セットアップ(+依存インストール)をした後に置きます。
置き場所の原則
- 必ず
actions/checkoutの後 python -m decikg...を叩くので、CIでpythonが使える(actions/setup-python済み)- 依存が入っている(
pip install -r ...済み) - 可能なら
pip install -e .も済み(もしくはPYTHONPATHが通る)
cd decikgしてるので、リポジトリ直下にdecikg/ディレクトリがある構成が前提
典型例:この順番の「ここ」に入れる
あなたの ci.yml がだいたいこういう形なら、Install dependencies の直後に挿します。
name: CI
on:
pull_request:
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install -U pip
cd decikg
pip install -r requirements.txt
pip install -e .
# ✅ ここに「Regression + Contract check」を入れる
- name: Regression (detail/rank) + Contract check (v0.1)
shell: bash
run: |
set -euo pipefail
cd decikg
# ...(あなたに出した block 全体)...
- name: Upload regression artifacts (logs + responses)
if: always()
uses: actions/upload-artifact@v4
with:
name: graph-query-regression-artifacts
path: |
/tmp/run_detail.check.log
/tmp/run_rank.check.log
/tmp/run_contract_check.log
/tmp/responses_detail.check.jsonl
/tmp/responses_rank.check.jsonl
コメントを残す