Repository navigation
48 lines (48 loc) · 1.71 KB
/
Copy pathmain.yml
File metadata and controls
48 lines (48 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: CI tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.2']
gemfile: ['faraday_1', 'faraday_2']
ES_VERSION: ['8.18.0']
include:
- ES_VERSION: '8.18.0'
ES_DOWNLOAD_URL: >-
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.18.0-linux-x86_64.tar.gz
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Cache Elasticsearch
id: cache-elasticsearch
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
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 -Expack.security.enabled=false'
- run: gem install bundler
- run: bundle install
- run: script/poll-for-es
- run: bundle exec rake test