Skip to content

Commit 84dab42

Browse files
committed
Add compatibility testing workflow
1 parent ee15c46 commit 84dab42

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

.github/workflows/compatibility.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: e2e
2+
3+
on:
4+
push:
5+
branches: # Once a PR is merged
6+
- main
7+
pull_request: # Temp while testing in PR
8+
schedule:
9+
- cron: "0 5 * * *" # 5am every day
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
18+
19+
env:
20+
# (keep_serverless-staging-oblt, keep_serverless-qa-oblt or serverless-production-oblt)
21+
SERVERLESS_PROJECT: keep_serverless-qa-oblt
22+
23+
jobs:
24+
25+
system-tests:
26+
runs-on: ubuntu-latest
27+
# Skip pull_request event from forks and dependabot
28+
if: github.event_name != 'pull_request' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
29+
permissions:
30+
contents: read
31+
id-token: write
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
# NOTE: edge-oblt version is the next major version for APM Server
36+
# dev-oblt version is the the next minor release for APM Server
37+
# release-oblt version is the latest release or current BC for APM Server
38+
remote-cluster:
39+
- 'edge-oblt'
40+
- 'dev-oblt'
41+
- 'release-oblt'
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Bootstrap Action Workspace
46+
id: bootstrap
47+
uses: ./.github/workflows/bootstrap
48+
49+
- uses: elastic/oblt-actions/google/auth@v1
50+
51+
- name: Get token
52+
id: get_token
53+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
54+
with:
55+
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
56+
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
57+
permissions: >-
58+
{
59+
"contents": "write",
60+
"pull_requests": "read"
61+
}
62+
repositories: >-
63+
["observability-test-environments"]
64+
65+
- uses: elastic/oblt-actions/git/setup@v1
66+
with:
67+
github-token: ${{ steps.get_token.outputs.token }}
68+
69+
- name: Setup ephemeral cluster
70+
uses: elastic/oblt-actions/oblt-cli/cluster-create-ccs@v1
71+
id: cluster_create
72+
with:
73+
github-token: ${{ steps.get_token.outputs.token }}
74+
remote-cluster: ${{ matrix.remote-cluster }}
75+
cluster-name-prefix: 'dotnet'
76+
wait: 15
77+
78+
- name: Setup credentials for the ephemeral cluster
79+
uses: elastic/oblt-actions/oblt-cli/cluster-credentials@v1
80+
with:
81+
cluster-name: ${{ steps.cluster_create.outputs.cluster-name }}
82+
github-token: ${{ steps.get_token.outputs.token }}
83+
84+
# NOTE: you can now use the cluster credentials to run your tests
85+
# please see https://github.com/elastic/oblt-actions/tree/v1/oblt-cli/cluster-credentials#exported-environment-variables
86+
# for the environment variables that are set by this action
87+
- name: End-to-end tests
88+
run: ./build.sh test --test-suite=e2e
89+
env:
90+
E2E__ENDPOINT: "${{env.ELASTIC_APM_SERVER_URL}}"
91+
E2E__AUTHORIZATION: "Authorization=ApiKey ${{env.ELASTIC_APM_API_KEY}}"
92+
E2E__BROWSEREMAIL: "${{env.ELASTICSEARCH_USERNAME}}"
93+
E2E__BROWSERPASSWORD: "${{env.ELASTICSEARCH_PASSWORD}}"
94+
95+
- name: Tear down ephemeral cluster
96+
uses: elastic/oblt-actions/oblt-cli/cluster-destroy@v1
97+
if: always()
98+
continue-on-error: true
99+
with:
100+
github-token: ${{ steps.get_token.outputs.token }}
101+
cluster-name: ${{ steps.cluster_create.outputs.cluster-name }}

0 commit comments

Comments
 (0)