Cache + restore the solr artifacts #3965
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby: ['3.2', '3.3'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Write solr_wrapper config | |
run: | | |
mkdir -p ~/.solr_wrapper.yml | |
echo "download_dir: ~/.solr-artifacts" > ~/.solr_wrapper.yml | |
- name: Cache Solr | |
id: cache-solr-restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/.solr-artifacts | |
key: solr-9.6.1 | |
- name: Run tests | |
run: bundle exec rake | |
- name: Save Solr | |
id: cache-solr-save | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
~/.solr-artifacts | |
key: ${{ steps.cache-solr-restore.outputs.cache-primary-key }} |