Merge pull request #317 from KevinArellano94/patch-1 #303
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 tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby-version: ['3.2'] | |
ES_VERSION: ['5.6.15', '8.13.2'] | |
include: | |
- ES_VERSION: '5.6.15' | |
ES_DOWNLOAD_URL: >- | |
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.15.tar.gz | |
- ES_VERSION: '8.13.2' | |
ES_DOWNLOAD_URL: >- | |
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.13.2-linux-x86_64.tar.gz | |
steps: | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- uses: actions/checkout@v4 | |
- name: Cache Elasticsearch | |
id: cache-elasticsearch | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-elasticsearch | |
with: | |
path: ./elasticsearch-${{ matrix.ES_VERSION }} | |
key: ${{ env.cache-name }}-${{ matrix.ES_VERSION }} | |
- if: ${{ steps.cache-elasticsearch.outputs.cache-hit != 'true' }} | |
name: Download Elasticsearch | |
run: | | |
wget ${{ matrix.ES_DOWNLOAD_URL }} | |
tar -xzf elasticsearch-*.tar.gz | |
- if: ${{ matrix.ES_VERSION == '5.6.15' }} | |
name: Run Elasticsearch | |
run: './elasticsearch-${{ matrix.ES_VERSION }}/bin/elasticsearch -d' | |
- if: ${{ matrix.ES_VERSION != '5.6.15' }} | |
name: Run Elasticsearch | |
run: './elasticsearch-${{ matrix.ES_VERSION }}/bin/elasticsearch -d -Expack.security.enabled=false' | |
- run: gem install bundler | |
- run: bundle install | |
- run: script/poll-for-es | |
- run: bundle exec rake test |