From 112124d621169a19e7def5b8e859adca3116e6c0 Mon Sep 17 00:00:00 2001 From: austek Date: Thu, 22 Aug 2024 17:35:01 +0100 Subject: [PATCH] use scala 3.5.0 --- .github/workflows/ci.yml | 6 +++--- build.sbt | 7 +++++++ github-actions.sbt | 8 ++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7c4065..a539b8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,19 +83,19 @@ jobs: shell: bash run: sbt '++ ${{ matrix.scala }}' consumer/test - - name: pact-publish help + - name: Pact publish Windows if: contains(runner.os, 'windows') shell: bash run: pact-broker.bat publish "modules/examples/consumer/target/pacts" --consumer-app-version=${{ runner.os }}.${{ github.sha }} - - name: pact-publish help + - name: Pact publish *nix if: '!contains(runner.os, ''windows'')' shell: bash run: pact-broker publish "modules/examples/consumer/target/pacts" --consumer-app-version=${{ runner.os }}.${{ github.sha }} - name: Test Provider shell: bash - run: sbt '++ ${{ matrix.scala }}' -Dpactbroker.url=${PACT_BROKER_BASE_URL} -Dpactbroker.auth.username=${PACT_BROKER_USERNAME} -Dpactbroker.auth.password=${PACT_BROKER_PASSWORD} provider/test + run: sbt '++ ${{ matrix.scala }}' -Dpactbroker.url=${PACT_BROKER_BASE_URL} =${PACT_BROKER_USERNAME} =${PACT_BROKER_PASSWORD} provider/test - name: Compress target directories shell: bash diff --git a/build.sbt b/build.sbt index 65a5d0f..c7dad53 100644 --- a/build.sbt +++ b/build.sbt @@ -5,6 +5,12 @@ import TestEnvironment.* ThisBuild / scalaVersion := scalaV +lazy val pactOptions: Seq[Tests.Argument] = Seq( + Some(sys.env.getOrElse("PACT_BROKER_BASE_URL", "http://localhost:9292")).map(s => s"-Dpactbroker.url=$s"), + sys.env.get("PACT_BROKER_USERNAME").map(s => s"-Dpactbroker.auth.username=$s"), + sys.env.get("PACT_BROKER_PASSWORD").map(s => s"-Dpactbroker.auth.password=$s") +).flatten.map(o => Tests.Argument(jupiterTestFramework, o)) + lazy val plugin = project .in(file("modules/plugin")) .enablePlugins( @@ -41,6 +47,7 @@ lazy val provider = project basicSettings, Test / sbt.Keys.test := (Test / sbt.Keys.test).dependsOn(pluginRef / buildTestPluginDir).value, Test / envVars := Map("PACT_PLUGIN_DIR" -> ((pluginRef / target).value / "plugin").absolutePath), + testOptions ++= pactOptions, libraryDependencies ++= Dependencies.compile(avroCompiler, logback, pulsar4sCore, pulsar4sAvro, scalacheck) ++ Dependencies.test(assertJCore, jUnitInterface, pactProviderJunit), diff --git a/github-actions.sbt b/github-actions.sbt index abdaa3a..3113e76 100644 --- a/github-actions.sbt +++ b/github-actions.sbt @@ -29,7 +29,7 @@ ThisBuild / githubWorkflowBuild := Seq( commands = List("consumer/test") ), WorkflowStep.Run( - name = Some("pact-publish help"), + name = Some("Pact publish Windows"), commands = List( """pact-broker.bat publish | "modules/examples/consumer/target/pacts" @@ -38,7 +38,7 @@ ThisBuild / githubWorkflowBuild := Seq( cond = Some("contains(runner.os, 'windows')") ), WorkflowStep.Run( - name = Some("pact-publish help"), + name = Some("Pact publish *nix"), commands = List( """pact-broker publish | "modules/examples/consumer/target/pacts" @@ -50,8 +50,8 @@ ThisBuild / githubWorkflowBuild := Seq( name = Some("Test Provider"), commands = List( "-Dpactbroker.url=${PACT_BROKER_BASE_URL}", - "-Dpactbroker.auth.username=${PACT_BROKER_USERNAME}", - "-Dpactbroker.auth.password=${PACT_BROKER_PASSWORD}", + "=${PACT_BROKER_USERNAME}", + "=${PACT_BROKER_PASSWORD}", "provider/test" ) )