From 7d0f010b6deb13772c4bdf2480ed072e32255664 Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Thu, 4 Dec 2025 11:53:17 +0900 Subject: [PATCH 01/10] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 67ed1fe..e2031cc 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -44,7 +44,7 @@ jobs: git checkout --orphan coverage-report git rm -rf . # すべてのファイルを削除 else - git checkout coverage-report + git checkout -t origin/coverage-report fi - name: Coverage Report From 2c7d19f67dd545da0a637e05bf561563ced8756c Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Thu, 4 Dec 2025 11:55:41 +0900 Subject: [PATCH 02/10] test --- .github/workflows/pytest.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e2031cc..250098e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -41,10 +41,9 @@ jobs: run: | # coverage-report ブランチが存在しない場合は作成 あればチェックアウト if ! git ls-remote --exit-code origin coverage-report; then + # coverage-report ブランチが存在しない場合は作成 git checkout --orphan coverage-report git rm -rf . # すべてのファイルを削除 - else - git checkout -t origin/coverage-report fi - name: Coverage Report From bcf820385be8ed382abf2d83697bba67d6bbcf46 Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Thu, 4 Dec 2025 11:55:55 +0900 Subject: [PATCH 03/10] test --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 250098e..306b608 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -42,6 +42,8 @@ jobs: # coverage-report ブランチが存在しない場合は作成 あればチェックアウト if ! git ls-remote --exit-code origin coverage-report; then # coverage-report ブランチが存在しない場合は作成 + git checkout -t origin/coverage-report + else git checkout --orphan coverage-report git rm -rf . # すべてのファイルを削除 fi From e6f6b8cc90331e2740877519a2b36af2afbd1380 Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Thu, 4 Dec 2025 11:58:31 +0900 Subject: [PATCH 04/10] =?UTF-8?q?=E9=A0=86=E7=95=AA=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 306b608..5edc624 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -35,6 +35,16 @@ jobs: run: | pytest --junitxml=pytest.xml --cov-report term-missing --cov=src tests/ | tee pytest-coverage.txt + - name: Coverage Report + id: CoverageReport + if: success() # テスト成功時のみ実行 + run: | + python - < README.md echo "" >> README.md echo "![test](coverage.svg)" >> README.md From 397bdbbc1411268424473bd32156fa41744f1e16 Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Thu, 4 Dec 2025 12:01:16 +0900 Subject: [PATCH 05/10] =?UTF-8?q?pytest=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5edc624..6f2c056 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -39,6 +39,7 @@ jobs: id: CoverageReport if: success() # テスト成功時のみ実行 run: | + coverage-badge -o /temp/coverage.svg python - < coverage.svg echo "# Pytest Report" > README.md echo "" >> README.md echo "![test](coverage.svg)" >> README.md From 757aa11f948d45c7fe4d5b64e8cf2b4311b49a04 Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Thu, 4 Dec 2025 12:29:47 +0900 Subject: [PATCH 06/10] test --- .github/workflows/pytest.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 6f2c056..fc464ce 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -39,7 +39,7 @@ jobs: id: CoverageReport if: success() # テスト成功時のみ実行 run: | - coverage-badge -o /temp/coverage.svg + coverage-badge -o .coverage.svg python - < coverage.svg + ls -l + mv .coverage.svg coverage.svg echo "# Pytest Report" > README.md echo "" >> README.md echo "![test](coverage.svg)" >> README.md From f38c8c126f0ca62836cb5c0f05121cebe10cbe04 Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Thu, 4 Dec 2025 12:31:12 +0900 Subject: [PATCH 07/10] test --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index fc464ce..6d20edb 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -52,8 +52,10 @@ jobs: run: | # coverage-report ブランチが存在しない場合は作成 あればチェックアウト if git ls-remote --exit-code origin coverage-report; then + echo "coverage-report branch exists" git checkout -t origin/coverage-report else + echo "coverage-report branch does not exist" git checkout --orphan coverage-report git rm -rf . # すべてのファイルを削除 fi From 27954a1677c0a79e3ebffb7bfe6fbf5021cede56 Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Thu, 4 Dec 2025 12:34:37 +0900 Subject: [PATCH 08/10] =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 6d20edb..736973e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -53,7 +53,8 @@ jobs: # coverage-report ブランチが存在しない場合は作成 あればチェックアウト if git ls-remote --exit-code origin coverage-report; then echo "coverage-report branch exists" - git checkout -t origin/coverage-report + git fetch origin coverage-report:coverage-report + git checkout -t coverage-report else echo "coverage-report branch does not exist" git checkout --orphan coverage-report From e34abe9eee1075ea77de69085deadc4d57979d78 Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Thu, 4 Dec 2025 12:36:07 +0900 Subject: [PATCH 09/10] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 736973e..1c76f67 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -54,7 +54,7 @@ jobs: if git ls-remote --exit-code origin coverage-report; then echo "coverage-report branch exists" git fetch origin coverage-report:coverage-report - git checkout -t coverage-report + git checkout -B coverage-report origin/coverage-report else echo "coverage-report branch does not exist" git checkout --orphan coverage-report From 00ea7cd2fe43d3e6ec52fe50fc26aa2eb982b074 Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Thu, 4 Dec 2025 12:42:29 +0900 Subject: [PATCH 10/10] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E7=B5=90?= =?UTF-8?q?=E6=9E=9C=E3=83=AC=E3=83=9D=E3=83=BC=E3=83=88=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 1c76f67..113ddea 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -86,6 +86,14 @@ jobs: run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add README.md coverage.svg - git commit -m "Update coverage report" - git push https://actions-bot:${{ secrets.CICD_GITEA_TOKEN }}@gitea.pglikers.com/data-science/cloud-run-job-base.git coverage-report --force + + # 変更があるかどうか確認(ステージング領域) + if git diff --cached --quiet; then + echo "No changes to commit" + else + git commit -m "Update coverage report" + git push https://actions-bot:${{ secrets.CICD_GITEA_TOKEN }}@gitea.pglikers.com/data-science/cloud-run-job-base.git coverage-report --force + fi +