From 2efcea05a1a0ec15f3612e17e609faf7d8538697 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Wed, 26 Feb 2025 07:15:51 +0000 Subject: [PATCH] Add compatibility testing workflow --- .github/workflows/compatibility.yml | 102 ++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 .github/workflows/compatibility.yml diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml new file mode 100644 index 0000000..b772f04 --- /dev/null +++ b/.github/workflows/compatibility.yml @@ -0,0 +1,102 @@ +name: compatibility + +on: + push: + branches: # Once a PR is merged + - main + pull_request: # Temp while testing in PR + schedule: + - cron: "0 5 * * *" # 5am every day + +permissions: + contents: read + id-token: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +env: + # (keep_serverless-staging-oblt, keep_serverless-qa-oblt or serverless-production-oblt) + SERVERLESS_PROJECT: keep_serverless-qa-oblt + +jobs: + + system-tests: + runs-on: ubuntu-latest + # Skip pull_request event from forks and dependabot + if: github.event_name != 'pull_request' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' + permissions: + contents: read + id-token: write + strategy: + fail-fast: false + matrix: + # NOTE: edge-oblt version is the next major version for APM Server + # dev-oblt version is the the next minor release for APM Server + # release-oblt version is the latest release or current BC for APM Server + remote-cluster: + - 'edge-oblt' + - 'dev-oblt' + - 'release-oblt' + steps: + - uses: actions/checkout@v4 + + - name: Bootstrap Action Workspace + id: bootstrap + uses: ./.github/workflows/bootstrap + + - uses: elastic/oblt-actions/google/auth@v1 + + - name: Get token + id: get_token + uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + with: + app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }} + private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} + permissions: >- + { + "contents": "write", + "pull_requests": "read" + } + repositories: >- + ["observability-test-environments"] + + - uses: elastic/oblt-actions/git/setup@v1 + with: + github-token: ${{ steps.get_token.outputs.token }} + + - name: Setup ephemeral cluster + uses: elastic/oblt-actions/oblt-cli/cluster-create-ccs@v1 + id: cluster_create + with: + github-token: ${{ steps.get_token.outputs.token }} + remote-cluster: ${{ matrix.remote-cluster }} + cluster-name-prefix: 'dotnet' + wait: 15 + + - name: Setup credentials for the ephemeral cluster + uses: elastic/oblt-actions/oblt-cli/cluster-credentials@v1 + with: + cluster-name: ${{ steps.cluster_create.outputs.cluster-name }} + github-token: ${{ steps.get_token.outputs.token }} + + # NOTE: you can now use the cluster credentials to run your tests + # please see https://github.com/elastic/oblt-actions/tree/v1/oblt-cli/cluster-credentials#exported-environment-variables + # for the environment variables that are set by this action + - name: End-to-end tests + run: ./build.sh test --test-suite=e2e + continue-on-error: true + env: + E2E__ENDPOINT: "${{env.ELASTIC_APM_SERVER_URL}}" + E2E__AUTHORIZATION: "Authorization=ApiKey ${{env.ELASTIC_APM_API_KEY}}" + E2E__BROWSEREMAIL: "${{env.ELASTICSEARCH_USERNAME}}" + E2E__BROWSERPASSWORD: "${{env.ELASTICSEARCH_PASSWORD}}" + + - name: Tear down ephemeral cluster + uses: elastic/oblt-actions/oblt-cli/cluster-destroy@v1 + if: always() + continue-on-error: true + with: + github-token: ${{ steps.get_token.outputs.token }} + cluster-name: ${{ steps.cluster_create.outputs.cluster-name }} \ No newline at end of file