From 651e15a7274649a1e8a5b4f3518e862d25942b7f Mon Sep 17 00:00:00 2001 From: austek Date: Sun, 12 Jan 2025 14:35:51 +0000 Subject: [PATCH] Add pact-broker container to workflow --- .github/workflows/ci.yml | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91124c1..565e345 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,30 +20,6 @@ env: jobs: build: name: Build and Test - container: - image: pactfoundation/pact-broker - ports: - - 9292 - env: - PACT_BROKER_PORT: '9292' - PACT_BROKER_DATABASE_URL: "postgres://postgres:password@postgres/postgres" - PACT_BROKER_LOG_LEVEL: INFO - PACT_BROKER_SQL_LOG_LEVEL: DEBUG - # PACT_BROKER_DATABASE_CONNECT_MAX_RETRIES is only needed for docker-compose - # because the database takes longer to start up than the puma process - # Should not be needed in production. - PACT_BROKER_DATABASE_CONNECT_MAX_RETRIES: "5" - # The list of allowed base URLs (not setting this makes the app vulnerable to cache poisoning) - # This list allows the app to be addressed from the host and from within another docker container correctly - # Ngnix config below makes the app accessible on ports 443 and 80, while the Ruby application itself runs on port 9292 - PACT_BROKER_BASE_URL: 'https://localhost http://localhost http://localhost:9292 http://pact-broker:9292 https://host.docker.internal http://host.docker.internal http://host.docker.internal:9292' - services: - postgres: - image: postgres - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password - POSTGRES_DB: postgres strategy: fail-fast: false matrix: @@ -93,6 +69,9 @@ jobs: shell: bash run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck + - name: Start containers + run: docker compose -f docker-compose.yml up -d + - name: Set outputs id: vars shell: bash @@ -127,6 +106,10 @@ jobs: shell: bash run: sbt '++ ${{ matrix.scala }}' provider/test + - name: Stop containers + if: always() + run: docker compose -f docker-compose.yml down + - name: Compress target directories shell: bash run: tar cf targets.tar target modules/plugin/target modules/examples/provider/target modules/examples/consumer/target project/target