|
| 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