Skip to content

Add CI workflow to test spinning up docker compose #51

@Mark90

Description

@Mark90

Add a github actions workflow to spin up docker compose and perform some checks on the services.

This should make it easier to detect that a PR will leave the repository in a broken state.

  1. Health Checks
    If your services have health checks defined, you can wait for them to become healthy.
    Example GitHub Actions Step:
name: Start services and wait for health
  run: |
    docker compose up -d
    docker compose ps --services | xargs -I {} sh -c 'docker inspect --format "{{.State.Health.Status}}" {}_1 | grep -q healthy || exit 1'
  1. Integration Testing
    You can run tests against your running services. For example, if you have a web service, you can use curl or a testing tool like pytest to verify endpoints.
    Example GitHub Actions Step:
name: Run integration tests
  run: |
    docker compose up -d
    # Example: Test if a web service is reachable
    curl --retry 5 --retry-delay 5 --retry-connrefused http://localhost:8080/health

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions