1- name : ' Setup Integration Test Environment'
2- description : ' Common setup steps for integration and secure integration tests'
1+ name : ' Setup Test Environment'
2+ description : ' Common setup steps for unit, integration and secure integration tests'
33
44inputs :
55 elastic_stack_version :
99 description : ' Whether to use snapshot version'
1010 required : false
1111 default : ' false'
12+ docker_env :
13+ description : ' Docker environment file (e.g., dockerjdk21.env)'
14+ required : false
15+ default : ' '
16+ integration :
17+ description : ' Enable integration testing'
18+ required : false
19+ default : ' false'
1220 secure_integration :
1321 description : ' Enable secure integration testing'
1422 required : false
@@ -35,42 +43,59 @@ runs:
3543 env :
3644 ELASTIC_STACK_VERSION : ${{ inputs.elastic_stack_version }}
3745 SNAPSHOT : ${{ inputs.snapshot }}
46+ DOCKER_ENV : ${{ inputs.docker_env }}
47+ INTEGRATION : ${{ inputs.integration }}
3848 SECURE_INTEGRATION : ${{ inputs.secure_integration }}
3949 ES_SSL_KEY_INVALID : ${{ inputs.es_ssl_key_invalid }}
4050 ES_SSL_SUPPORTED_PROTOCOLS : ${{ inputs.es_ssl_supported_protocols }}
4151 run : |
42- echo "INTEGRATION=true" >> $GITHUB_ENV
4352 echo "LOG_LEVEL=info" >> $GITHUB_ENV
4453 echo "ELASTIC_STACK_VERSION=${ELASTIC_STACK_VERSION}" >> $GITHUB_ENV
4554
4655 if [ "${SNAPSHOT}" = "true" ]; then
4756 echo "SNAPSHOT=true" >> $GITHUB_ENV
4857 fi
49-
58+
59+ if [ -n "${DOCKER_ENV}" ]; then
60+ echo "DOCKER_ENV=${DOCKER_ENV}" >> $GITHUB_ENV
61+ fi
62+
63+ if [ "${INTEGRATION}" = "true" ]; then
64+ echo "INTEGRATION=true" >> $GITHUB_ENV
65+ fi
66+
5067 if [ "${SECURE_INTEGRATION}" = "true" ]; then
5168 echo "SECURE_INTEGRATION=true" >> $GITHUB_ENV
5269 fi
53-
70+
5471 if [ "${ES_SSL_KEY_INVALID}" = "true" ]; then
5572 echo "ES_SSL_KEY_INVALID=true" >> $GITHUB_ENV
5673 fi
57-
74+
5875 if [ -n "${ES_SSL_SUPPORTED_PROTOCOLS}" ]; then
5976 echo "ES_SSL_SUPPORTED_PROTOCOLS=${ES_SSL_SUPPORTED_PROTOCOLS}" >> $GITHUB_ENV
6077 fi
6178
6279 - name : Setup Docker Buildx
6380 uses : docker/setup-buildx-action@v3
6481
82+ - name : Bootstrap CI assets
83+ shell : bash
84+ run : |
85+ mkdir -p .ci
86+ curl -sL https://github.com/logstash-plugins/.ci/archive/1.x.tar.gz | \
87+ sh -c 'if tar --version 2>/dev/null | grep -q "GNU tar"; then
88+ TAR_KEEP="--skip-old-files"; TAR_WILDCARDS="--wildcards";
89+ else
90+ TAR_KEEP="-k"; TAR_WILDCARDS="";
91+ fi; tar -xzvf - $TAR_KEEP --strip-components=1 -C .ci $TAR_WILDCARDS "*Dockerfile*" "*docker*" "*.sh" "*logstash-versions*"'
92+
6593 - name : Run docker-setup.sh
6694 id : docker_setup
6795 shell : bash
6896 run : |
69- set -e
70- cd .ci
71- wget -q https://raw.githubusercontent.com/elastic/logstash/main/.ci/docker-setup.sh -O .ci/docker-setup.shhttps://raw.githubusercontent.com/logstash-plugins/.ci/refs/heads/1.x/docker-setup.sh || exit 1
72- chmod 755 docker-setup.sh
7397 bash .ci/docker-setup.sh
98+ echo "exit_code=$?" >> $GITHUB_OUTPUT
7499 continue-on-error : true
75100
76101 - name : Check if test should be skipped
0 commit comments