Skip to content

Commit 94d8c5c

Browse files
committed
ci: github actions
1 parent 1b84db7 commit 94d8c5c

File tree

2 files changed

+178
-0
lines changed

2 files changed

+178
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Integration Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "[0-9]+.[0-9]+"
8+
pull_request:
9+
branches:
10+
- main
11+
- "[0-9]+.[0-9]+"
12+
workflow_dispatch:
13+
14+
jobs:
15+
integration-tests:
16+
name: Integration Test - ES ${{ matrix.elastic_stack_version }} ${{ matrix.snapshot && '(Snapshot)' || '' }}
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
elastic_stack_version:
22+
- "7.current"
23+
- "8.previous"
24+
- "8.current"
25+
- "9.current"
26+
snapshot: [false, true]
27+
include:
28+
- elastic_stack_version: "main"
29+
snapshot: true
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
35+
- name: Set up environment variables
36+
run: |
37+
echo "INTEGRATION=true" >> $GITHUB_ENV
38+
echo "LOG_LEVEL=info" >> $GITHUB_ENV
39+
echo "ELASTIC_STACK_VERSION=${{ matrix.elastic_stack_version }}" >> $GITHUB_ENV
40+
if [ "${{ matrix.snapshot }}" = "true" ]; then
41+
echo "SNAPSHOT=true" >> $GITHUB_ENV
42+
fi
43+
44+
- name: Setup Docker Buildx
45+
uses: docker/setup-buildx-action@v3
46+
47+
- name: Run docker-setup.sh
48+
id: docker_setup
49+
run: |
50+
set -e
51+
bash .ci/docker-setup.sh
52+
continue-on-error: true
53+
54+
- name: Check if test should be skipped
55+
id: check_skip
56+
if: steps.docker_setup.outcome == 'failure'
57+
run: |
58+
if [ ${{ steps.docker_setup.outputs.exit_code }} -eq 99 ]; then
59+
echo "skip=true" >> $GITHUB_OUTPUT
60+
echo "Test skipped - Docker image not available for this configuration"
61+
else
62+
exit 1
63+
fi
64+
65+
- name: Run integration tests
66+
if: steps.check_skip.outputs.skip != 'true'
67+
run: |
68+
bash .ci/docker-run.sh
69+
70+
- name: Cleanup
71+
if: always()
72+
run: |
73+
cd .ci
74+
docker compose down -v || true
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Secure Integration Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "[0-9]+.[0-9]+"
8+
pull_request:
9+
branches:
10+
- main
11+
- "[0-9]+.[0-9]+"
12+
workflow_dispatch:
13+
14+
jobs:
15+
secure-integration-tests:
16+
name: Secure Integration Test - ES ${{ matrix.elastic_stack_version }} ${{ matrix.snapshot && '(Snapshot)' || '' }} ${{ matrix.es_ssl_key_invalid && '(Invalid SSL)' || '' }} ${{ matrix.es_ssl_supported_protocols && format('({0})', matrix.es_ssl_supported_protocols) || '' }}
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
# Regular secure integration tests
23+
- elastic_stack_version: "7.current"
24+
snapshot: false
25+
- elastic_stack_version: "8.current"
26+
snapshot: false
27+
- elastic_stack_version: "9.current"
28+
snapshot: false
29+
30+
# SSL configuration tests for 8.current
31+
- elastic_stack_version: "8.current"
32+
snapshot: false
33+
es_ssl_key_invalid: true
34+
- elastic_stack_version: "8.current"
35+
snapshot: false
36+
es_ssl_supported_protocols: "TLSv1.3"
37+
38+
# SSL configuration tests for 9.current
39+
- elastic_stack_version: "9.current"
40+
snapshot: false
41+
es_ssl_key_invalid: true
42+
- elastic_stack_version: "9.current"
43+
snapshot: false
44+
es_ssl_supported_protocols: "TLSv1.3"
45+
46+
# Snapshot tests
47+
- elastic_stack_version: "8.current"
48+
snapshot: true
49+
- elastic_stack_version: "9.current"
50+
snapshot: true
51+
- elastic_stack_version: "main"
52+
snapshot: true
53+
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: Set up environment variables
59+
run: |
60+
echo "SECURE_INTEGRATION=true" >> $GITHUB_ENV
61+
echo "INTEGRATION=true" >> $GITHUB_ENV
62+
echo "LOG_LEVEL=info" >> $GITHUB_ENV
63+
echo "ELASTIC_STACK_VERSION=${{ matrix.elastic_stack_version }}" >> $GITHUB_ENV
64+
if [ "${{ matrix.snapshot }}" = "true" ]; then
65+
echo "SNAPSHOT=true" >> $GITHUB_ENV
66+
fi
67+
if [ "${{ matrix.es_ssl_key_invalid }}" = "true" ]; then
68+
echo "ES_SSL_KEY_INVALID=true" >> $GITHUB_ENV
69+
fi
70+
if [ -n "${{ matrix.es_ssl_supported_protocols }}" ]; then
71+
echo "ES_SSL_SUPPORTED_PROTOCOLS=${{ matrix.es_ssl_supported_protocols }}" >> $GITHUB_ENV
72+
fi
73+
74+
- name: Setup Docker Buildx
75+
uses: docker/setup-buildx-action@v3
76+
77+
- name: Run docker-setup.sh
78+
id: docker_setup
79+
run: |
80+
set -e
81+
bash .ci/docker-setup.sh
82+
continue-on-error: true
83+
84+
- name: Check if test should be skipped
85+
id: check_skip
86+
if: steps.docker_setup.outcome == 'failure'
87+
run: |
88+
if [ ${{ steps.docker_setup.outputs.exit_code }} -eq 99 ]; then
89+
echo "skip=true" >> $GITHUB_OUTPUT
90+
echo "Test skipped - Docker image not available for this configuration"
91+
else
92+
exit 1
93+
fi
94+
95+
- name: Run secure integration tests
96+
if: steps.check_skip.outputs.skip != 'true'
97+
run: |
98+
bash .ci/docker-run.sh
99+
100+
- name: Cleanup
101+
if: always()
102+
run: |
103+
cd .ci
104+
docker compose down -v || true

0 commit comments

Comments
 (0)