Repository navigation
85 lines (84 loc) · 4.55 KB
/
Copy pathcompat.yml
File metadata and controls
85 lines (84 loc) · 4.55 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: compat build
on:
- push
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check_compat:
name: Check ${{ matrix.versionTitle }}
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- versionTitle: ElasticSearch 7.17.25
dockerCommand: |
docker run -d --rm --name es -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.17.25
readyCondition: GREEN
- versionTitle: ElasticSearch 8.19.16
dockerCommand: |
docker run -d --rm --name es -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" -e "xpack.ml.enabled=false" -e "xpack.watcher.enabled=false" -e "ES_JAVA_OPTS=-Xms2g -Xmx2g" docker.elastic.co/elasticsearch/elasticsearch:8.19.16
readyCondition: GREEN
- versionTitle: ElasticSearch 9.4.2
dockerCommand: |
docker run -d --rm --name es -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" -e "xpack.ml.enabled=false" -e "xpack.watcher.enabled=false" docker.elastic.co/elasticsearch/elasticsearch:9.4.2
readyCondition: GREEN
- versionTitle: OpenSearch 1.3.19
dockerCommand: |
docker run -d --rm --name es -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9600 -e "discovery.type=single-node" -e DISABLE_SECURITY_PLUGIN="true" -e DISABLE_INSTALL_DEMO_CONFIG="true" opensearchproject/opensearch:1.3.19
readyCondition: version hash ring successfully
- versionTitle: OpenSearch 2.19.5
dockerCommand: |
docker run -d --rm --name es -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9600 -e "discovery.type=single-node" -e DISABLE_SECURITY_PLUGIN="true" -e DISABLE_INSTALL_DEMO_CONFIG="true" opensearchproject/opensearch:2.19.5
readyCondition: version hash ring successfully
- versionTitle: OpenSearch 3.7.0
dockerCommand: |
docker run -d --rm --name es -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9600 -e "discovery.type=single-node" -e DISABLE_SECURITY_PLUGIN="true" -e DISABLE_INSTALL_DEMO_CONFIG="true" opensearchproject/opensearch:3.7.0
readyCondition: version hash ring successfully
fail-fast: false
steps:
- name: git checkout
uses: actions/checkout@v5
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v22
with:
extra-conf: |
system-features = nixos-test benchmark big-parallel kvm
experimental-features = nix-command flakes
- name: Launch docker
run: |
${{ matrix.dockerCommand }}
# Wait for the cluster to be reachable and out of the RED/init
# state. The old `docker logs es | grep GREEN` gate was flaky:
# a single-node cluster is GREEN only briefly at boot (it drops
# to YELLOW once replica-bearing indices exist), and a slow image
# start missed that window entirely — surfacing as `timeout`
# exit 124. Polling the HTTP health endpoint is reliable across
# ES 7/8/9 and OpenSearch.
timeout 300 bash -c 'until curl -fsS http://localhost:9200/_cluster/health 2>/dev/null | grep -qE "\"status\":\"(green|yellow)\""; do sleep 2; done'
# Relax disk watermarks: GHA runners have limited disk and ES/OS
# block writes (cluster RED) once the high watermark (90%) is crossed.
curl -s -X PUT "http://localhost:9200/_cluster/settings" \
-H 'Content-Type: application/json' \
-d '{"transient":{"cluster.routing.allocation.disk.threshold_enabled":false}}' >/dev/null || true
- id: code-hash
name: Compute code directory hash
run: |
code_hash=$(git rev-parse HEAD:code | head -c 8)-$(git rev-parse HEAD:tests | head -c 8)-$(git rev-parse HEAD:bloodhound.cabal | head -c 8)
echo "code-hash=$code_hash" >> "$GITHUB_OUTPUT"
- name: Setup cache
id: cache-build
uses: actions/cache@v5
with:
path: ~/.cabal/store
key: compat-build-${{ steps.code-hash.outputs.code-hash}}
- name: Build with tests
run: nix develop --command bash -c 'cabal v2-build --enable-tests'
- name: Run tests
run: nix develop --command bash -c 'cabal test'
- name: Stop docker
if: always()
run: |
docker logs es
docker rm -f es