E2E #974
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
CONTEXT: . | |
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 }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.READ_PACKAGE_PAT }} | |
- name: Checkout trifork/cheetah-development-infrastructure | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
with: | |
repository: trifork/cheetah-development-infrastructure | |
token: ${{ secrets.READ_PACKAGE_PAT }} | |
path: integrationtests | |
- name: "Start e2e infrastructure" | |
working-directory: integrationtests/ | |
run: | | |
docker compose --profile core up -d --build | |
env: | |
DOCKER_REGISTRY: ghcr.io/trifork/ | |
INITIAL_KAFKA_TOPICS: cheetahwebapi | |
- 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 run --rm --network=cheetah-infrastructure nixery.dev/shell/bash/jq/curl curl -u admin:admin -sS -X GET -H "Content-Type: application/json" http://opensearch:9200/_cat/indices' | |
- name: "Start Cheetah.Webapi (example)" | |
working-directory: . | |
run: docker compose up -d --build | |
env: | |
GITHUB_ACTOR: ${{ github.actor }} | |
GITHUB_TOKEN: ${{ secrets.READ_PACKAGE_PAT }} | |
- name: "Check health" | |
id: "integrationtest" | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 1 | |
max_attempts: 25 | |
retry_wait_seconds: 5 | |
warning_on_retry: false | |
command: 'docker run --rm --network=cheetah-infrastructure nixery.dev/shell/bash/jq/curl curl -sS -X GET -H "Content-Type: application/json" http://cheetahwebapi:8080/health' | |
- name: "Check metrics" | |
shell: bash | |
run: | | |
docker run --rm --network=cheetah-infrastructure nixery.dev/shell/bash/jq/curl curl -sS -X GET -H "Content-Type: application/json" http://cheetahwebapi:8080/metrics | |
- name: "Print logs" | |
if: always() | |
run: "docker logs src-cheetah.webapi-1" # docker compose logs |