From 7ca28f0123ccefb379e0fd4341ae5421a6701519 Mon Sep 17 00:00:00 2001 From: Masataka Pocke Kuwabara Date: Fri, 31 Jan 2025 19:57:41 +0900 Subject: [PATCH] Remove gem cache for Windows --- .github/workflows/windows.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 63089b951..339c63723 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -20,6 +20,17 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} + + # ucrt and mswin have the dev version Ruby. + # It introduce checksum mismatches for bundled gems. So remove them before `bundle install` + - name: Purge gem caches + run: | + ruby -e ' + exit if "${{ matrix.ruby }}" != "ucrt" && "${{ matrix.ruby }}" != "mswin" + bundled_gems = Dir.glob("D:/ruby-${{ matrix.ruby }}/lib/ruby/gems/*/cache/*.gem") + .map { |path| File.basename(path, ".gem")[/^(.+)-[^-]+$/, 1] } + system "gem uninstall #{bundled_gems.join(" ")}", exception: true + ' - name: bundle install run: | bundle config set without profilers libs