Skip to content

Commit acddb9e

Browse files
committed
ci(release): install ripgrep on the Windows runner before the tests
- The v0.4.0 release run failed in go test: four reference-search tests call rg, which windows-latest does not ship, while the CI workflow on Ubuntu had been installing it all along - Those tests now skip when rg is absent, the same way the other rg-dependent tests in the package already do
1 parent c35f885 commit acddb9e

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ jobs:
1717
with:
1818
go-version-file: go.mod
1919

20+
# ripgrep が無いと検索経路のテストが skip される(test.yml と同じ理由)。
21+
# windows-latest には chocolatey が入っている
22+
- name: Install ripgrep
23+
run: choco install ripgrep -y --no-progress
24+
2025
- name: Run tests
2126
run: go test ./...
2227

search/refsites_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ func TestCapSitesReportsTruncation(t *testing.T) {
6565
// 部品が正しくても配線が食い違うのが今日の不具合だったので、ここを空けない。
6666
func writeRefFixture(t *testing.T) string {
6767
t.Helper()
68+
// 参照検索は rg で読むので、無い環境では失敗ではなく skip にする
69+
// (このパッケージの他の rg 依存テストと同じ扱い。v0.4.0 のリリース
70+
// ビルドが ripgrep 無しの Windows ランナーでここで落ちた)
71+
if _, err := exec.LookPath("rg"); err != nil {
72+
t.Skip("rg not installed")
73+
}
6874
dir := t.TempDir()
6975
main := "" +
7076
"static int helper(int a);\n" + // 1: プロトタイプ宣言(囲む関数なし)

0 commit comments

Comments
 (0)