Skip to content

fix(elasticsearch-plugin): import health-check types from @vendure/core #110

fix(elasticsearch-plugin): import health-check types from @vendure/core

fix(elasticsearch-plugin): import health-check types from @vendure/core #110

Workflow file for this run

name: Build & Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20.x, 22.x]
search-backend: [elasticsearch, opensearch]
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:9.1.0
env:
discovery.type: single-node
bootstrap.memory_lock: 'true'
xpack.security.enabled: 'false'
xpack.security.http.ssl.enabled: 'false'
xpack.security.transport.ssl.enabled: 'false'
xpack.license.self_generated.type: basic
ES_JAVA_OPTS: '-Xms512m -Xmx512m'
ports:
- 9200:9200
options: >-
--health-cmd "curl -s http://localhost:9200/_cluster/health | grep -vq '\"status\":\"red\"'"
--health-interval 10s
--health-timeout 5s
--health-retries 10
opensearch:
image: opensearchproject/opensearch:3.0.0
env:
discovery.type: single-node
cluster.name: opensearch-docker-cluster
node.name: os
bootstrap.memory_lock: 'true'
DISABLE_SECURITY_PLUGIN: 'true'
DISABLE_INSTALL_DEMO_CONFIG: 'true'
OPENSEARCH_JAVA_OPTS: '-Xms512m -Xmx512m'
ports:
# Host 9201 -> container 9200 so OS runs alongside ES (which keeps 9200).
- 9201:9200
options: >-
--health-cmd "curl -s http://localhost:9200/_cluster/health | grep -vq '\"status\":\"red\"'"
--health-interval 10s
--health-timeout 5s
--health-retries 20
redis:
image: redis:7.2-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.10
- run: bun install --frozen-lockfile
- run: bun run build
- name: Lint
run: bun run lint
- name: Run unit tests
run: bun run test
- name: Run e2e tests (${{ matrix.search-backend }})
run: bun run e2e
env:
CI: true
SEARCH_BACKEND: ${{ matrix.search-backend }}
E2E_ELASTIC_PORT: ${{ matrix.search-backend == 'opensearch' && '9201' || '9200' }}