Skip to content

Remove vestigial RBS definition of Config#health_check. #2278

Remove vestigial RBS definition of Config#health_check.

Remove vestigial RBS definition of Config#health_check. #2278

Workflow file for this run

# This file is generated by `script/update_ci_yaml` based on input from `config/tested_datastore_versions.yaml`.
# To edit it, make changes to the template at the bottom of `script/update_ci_yaml` and run it.
name: ElasticGraph CI
on:
push:
branches:
- main
pull_request:
env:
# It's recommended to run ElasticGraph with this option to get better performance. We want to run
# our CI builds with it to ensure that the option always works.
RUBYOPT: "--enable-frozen-string-literal"
# We use the VCR gem as a local "test accelerator" which caches datastore requests/responses for us.
# But in our CI build we don't want to use it at all, so we disable it here.
NO_VCR: "1"
docker_platforms: linux/amd64,linux/arm64
jobs:
ci-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_part:
- run_each_gem_spec
ruby:
- "3.4"
datastore:
- "elasticsearch:9.1.0"
- "elasticsearch:9.0.0"
- "opensearch:3.1.0"
- "opensearch:2.19.0"
include:
# We have 4 build parts. The "primary" one is `run_each_gem_spec`, and we need that to be run on
# every supported Ruby version and against every supported datastore. It's not necessary to run
# these others against every combination of `ruby` and `datastore` so we just run each with one
# configuration here.
- build_part: "run_misc_checks"
ruby: "3.4"
datastore: "elasticsearch:9.1.0"
- build_part: "run_specs_with_vcr"
ruby: "3.4"
datastore: "elasticsearch:9.1.0"
- build_part: "run_specs_file_by_file"
ruby: "3.4"
datastore: "elasticsearch:9.1.0"
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Ruby
uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup Docker Compose
uses: KengoTODA/actions-setup-docker-compose@aa468051c6851848da9bfe114e7eac913c0bf59c # v1.2.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config --global user.name "GitHub Action Bot"
git config --global user.email "action@github.com"
git config --global init.defaultBranch main
- name: Run Build Part
# Note: the `10` argument on the end is a number of seconds to sleep after booting the datastore.
# We've found that there is a minor race condition where the shards aren't fully ready for the tests
# to hit them if we don't wait a bit after booting.
run: script/ci_parts/${{ matrix.build_part }} ${{ matrix.datastore }} 10
docker-demo:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
OPENSEARCH_VERSION: "3.1.0"
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Ruby
uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
with:
ruby-version: "3.4"
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
with:
driver: docker-container
- name: Build OpenSearch image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: elasticgraph-local/lib/elastic_graph/local/opensearch
file: elasticgraph-local/lib/elastic_graph/local/opensearch/Dockerfile
push: false
load: true
build-args: |
VERSION=${{ env.OPENSEARCH_VERSION }}
tags: |
elasticgraph-opensearch-demo:latest
- name: Build ElasticGraph image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: config/docker_demo/Dockerfile
push: false
load: true
tags: |
elasticgraph-demo:latest
- name: Test docker images
env:
NO_BUILD: "true"
run: config/docker_demo/test
- name: Login to GitHub Container Registry
if: success() && github.ref == 'refs/heads/main'
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push OpenSearch image
if: success() && github.ref == 'refs/heads/main'
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: elasticgraph-local/lib/elastic_graph/local/opensearch
file: elasticgraph-local/lib/elastic_graph/local/opensearch/Dockerfile
push: true
platforms: ${{ env.docker_platforms }}
build-args: |
VERSION=${{ env.OPENSEARCH_VERSION }}
tags: |
ghcr.io/${{ github.repository_owner }}/elasticgraph-opensearch-demo:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/elasticgraph-opensearch-demo:latest
- name: Push ElasticGraph image
if: success() && github.ref == 'refs/heads/main'
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: config/docker_demo/Dockerfile
push: true
platforms: ${{ env.docker_platforms }}
tags: |
ghcr.io/${{ github.repository_owner }}/elasticgraph-demo:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/elasticgraph-demo:latest
lint-workflows:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install action-validator with asdf
uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0
with:
tool_versions: |
action-validator 0.5.1
- name: Lint Actions
run: |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) \
| xargs -I {} action-validator --verbose {}
# An extra job that runs after all the others and provides a single summary status.
# This is used by our branch protection rule to block merge until all CI checks passed,
# without requiring us to individually list each CI check in the branch protection rule.
#
# https://github.com/orgs/community/discussions/26822#discussioncomment-3305794
all-ci-checks-passed:
if: ${{ always() }} # so it runs even if the workflow was cancelled
runs-on: ubuntu-latest
name: All CI Checks Passed
needs: [ci-check, docker-demo, lint-workflows]
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- run: |
result="${{ needs.ci-check.result }}"
docker_result="${{ needs.docker-demo.result }}"
if [[ $result == "success" || $result == "skipped" ]] && [[ $docker_result == "success" || $docker_result == "skipped" ]]; then
exit 0
else
exit 1
fi