Skip to content

Merge pull request #78 from ParentSquare/modernize #309

Merge pull request #78 from ParentSquare/modernize

Merge pull request #78 from ParentSquare/modernize #309

Workflow file for this run

---
name: CI
on:
push:
tags: ['v*']
branches: [master]
pull_request:
branches: ['**']
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.1', '3.2', '3.3', '3.4', jruby-head, truffleruby-head]
redis: ['5']
search: [['opensearch-ruby:3.4.0', 'opensearchproject/opensearch:2.19.5']]
include:
# Redis 4
- ruby: '3.4'
redis: '4'
search: ['opensearch-ruby:3.4.0', 'opensearchproject/opensearch:2.19.5']
# OpenSearch 3.x
- ruby: '3.4'
redis: '5'
search: ['opensearch-ruby:3.4.0', 'opensearchproject/opensearch:3.0.0']
# Elasticsearch 7.17 (last release of the pre-8 transport API
# that the Faulty patch currently targets). ES 8+ moves the
# transport into the `elastic-transport` gem under
# `Elastic::Transport`, which the patch does not yet support.
- ruby: '3.4'
redis: '5'
search: ['elasticsearch:7.17.11', 'elasticsearch:7.17.28']
services:
redis:
image: redis
ports:
- 6379:6379
search:
image: ${{ matrix.search[1] }}
ports:
- 9200:9200
env:
discovery.type: single-node
plugins.security.disabled: ${{ contains(matrix.search[1], 'opensearch') && 'true' || '' }}
xpack.security.enabled: ${{ contains(matrix.search[1], 'elasticsearch') && 'false' || '' }}
# OpenSearch 2.12+ requires an initial admin password for the
# security demo installer (which still runs even with
# `plugins.security.disabled=true`). Skip the demo config
# entirely so we don't have to set a placeholder password.
# Older OpenSearch and all Elasticsearch images ignore this.
DISABLE_INSTALL_DEMO_CONFIG: 'true'
options: >-
--health-cmd="curl http://localhost:9200/_cluster/health"
--health-interval=3s
--health-timeout=5s
--health-retries=20
env:
REDIS_VERSION: ${{ matrix.redis }}
SEARCH_GEM: ${{ matrix.search[0] }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: start MySQL
run: sudo /etc/init.d/mysql start
- run: bundle exec rspec --format doc
env:
MYSQL_USER: root
MYSQL_PASSWORD: root
- uses: codecov/codecov-action@v5
if: matrix.ruby == '3.4'
with:
files: coverage/coverage.xml
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- run: bundle exec rubocop
yard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- run: bin/yardoc --fail-on-warning
check_version:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- run: bin/check-version
release:
needs: [test, rubocop, yard, check_version]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dawidd6/action-publish-gem@v1
with:
api_key: ${{secrets.RUBYGEMS_API_KEY}}