Skip to content

Commit 7ca28f0

Browse files
committed
Remove gem cache for Windows
1 parent 88aa628 commit 7ca28f0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/windows.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ jobs:
2020
uses: ruby/setup-ruby@v1
2121
with:
2222
ruby-version: ${{ matrix.ruby }}
23+
24+
# ucrt and mswin have the dev version Ruby.
25+
# It introduce checksum mismatches for bundled gems. So remove them before `bundle install`
26+
- name: Purge gem caches
27+
run: |
28+
ruby -e '
29+
exit if "${{ matrix.ruby }}" != "ucrt" && "${{ matrix.ruby }}" != "mswin"
30+
bundled_gems = Dir.glob("D:/ruby-${{ matrix.ruby }}/lib/ruby/gems/*/cache/*.gem")
31+
.map { |path| File.basename(path, ".gem")[/^(.+)-[^-]+$/, 1] }
32+
system "gem uninstall #{bundled_gems.join(" ")}", exception: true
33+
'
2334
- name: bundle install
2435
run: |
2536
bundle config set without profilers libs

0 commit comments

Comments
 (0)