DEV: Cache plugin gems when running plugin test jobs in Github CI (#24535)

Why this change?

Plugin gems for official plugins are being installed over and over again
each time we run RSpec and QUnit tests for plugins. In particular, the
rugged gem installed by the discourse-code-review plugin takes
approximately 50-60 seconds to install because it is compiling libgit2.
This commit is contained in:
Alan Guo Xiang Tan 2023-11-27 07:22:32 +08:00 committed by GitHub
parent dc2a0854b0
commit 585e010af9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -117,6 +117,12 @@ jobs:
if: matrix.target == 'plugins'
run: bin/rake plugin:pull_compatible_all
- name: Plugin gems cache
uses: actions/cache@v3
with:
path: plugins/*/gems
key: ${{ runner.os }}-plugin-gems-${{matrix.ruby}}-${{ hashFiles('plugins/*/plugin.rb') }}
- name: Checkout official themes
if: matrix.target == 'themes' && matrix.build_type == 'system'
run: bin/rake themes:clone_all_official