-
Notifications
You must be signed in to change notification settings - Fork 117
62 lines (61 loc) · 2.53 KB
/
compat.yml
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
name: compat build
on:
- push
- pull_request
jobs:
check_compat:
name: Check ${{ matrix.versionTitle }}
runs-on: ubuntu-22.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: 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: Init AD version hash ring successfully
- versionTitle: OpenSearch 2.9.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:2.9.0
readyCondition: Init AD version hash ring successfully
fail-fast: false
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
system-features = nixos-test benchmark big-parallel kvm
experimental-features = nix-command flakes
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Launch docker
run: |
${{ matrix.dockerCommand }}
until docker logs es | grep '${{ matrix.readyCondition }}'
do
sleep 1
done
- 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@v4
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