-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (62 loc) · 2.56 KB
/
e2e.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
name: E2E
on:
workflow_call:
workflow_dispatch:
schedule:
- cron: "0 3 * * *"
push:
branches: ["main", "release/v**"]
pull_request:
branches: ["main", "release/v**"]
types: [opened, synchronize, reopened, labeled]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
CHEETAH_DOCKER_REGISTRY: ghcr.io/trifork/
jobs:
should-run:
uses: trifork/cheetah-infrastructure-utils-workflows/.github/workflows/e2e-should-run.yml@main
e2e-test:
needs: should-run
if: ${{ needs.should-run.outputs.should-run }}
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- name: Login to GitHub Container Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PACKAGE_PAT }} # we need this, as GITHUB_TOKEN only have permission to its own repo
# OpenSearch is required for integration tests
# - name: docker network create cheetah-infrastructure
# run: docker network create cheetah-infrastructure
- name: Run development environment
run: docker compose --profile opensearch --profile kafka --profile oauth --profile schemaregistry up --quiet-pull --force-recreate -d
- name: Start mye2eclient container in shared network
run: docker run -d -v "${PWD}/tests/:/opt/tests/" -it --name mye2eclient --network=cheetah-infrastructure alpine:latest
- name: Setup mye2eclient container
run: |
docker exec mye2eclient apk add curl jq bash httpie
- name: "Wait for opensearch, the slowest component"
uses: nick-fields/retry@v3
with:
timeout_minutes: 3
max_attempts: 25
retry_wait_seconds: 5
warning_on_retry: false
command: 'docker exec mye2eclient curl -sS -X GET -H "Content-Type: application/json" http://admin:admin@opensearch:9200/_cat/indices'
- name: Check docker health
run: |
echo $(docker compose ps -a | grep 'unhealthy')
docker compose ps -a | grep 'unhealthy' && echo "Services unhealthy" && exit 1 || exit 0
- name: opensearch test
run: docker exec mye2eclient bash /opt/tests/opensearch.sh
- name: kafka test
run: docker exec mye2eclient bash /opt/tests/kafka.sh
- name: schemaregistry test
run: docker exec mye2eclient bash /opt/tests/schemaregistry.sh