diff --git a/.github/workflows/testonpush.yml b/.github/workflows/ci.yml similarity index 60% rename from .github/workflows/testonpush.yml rename to .github/workflows/ci.yml index 4475e6f9..3e32e027 100644 --- a/.github/workflows/testonpush.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,13 @@ -name: Test on push - +name: CI on: + workflow_dispatch: + pull_request: + + # triggering CI default branch improves caching + # see https://docs.github.com/en/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache push: - branches: [ "**" ] - workflow_dispatch: {} + branches: + - main jobs: test: @@ -15,10 +19,10 @@ jobs: pull-requests: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: corretto java-version: 11 @@ -27,11 +31,10 @@ jobs: - name: Test env: CAPI_TEST_KEY: ${{ secrets.CAPI_TEST_KEY }} - SBT_JUNIT_OUTPUT: ./junit-tests JAVA_OPTS: -XX:+UseCompressedOops run: sbt test - uses: EnricoMi/publish-unit-test-result-action@v2 if: always() #runs even if there is a test failure with: - files: junit-tests/*.xml + files: test-results/**/TEST-*.xml diff --git a/build.sbt b/build.sbt index 5eccf180..40f11377 100644 --- a/build.sbt +++ b/build.sbt @@ -15,6 +15,7 @@ lazy val root = (project in file(".")) checkSnapshotDependencies, inquireVersions, runClean, + runTest, setReleaseVersion, commitReleaseVersion, tagRelease, @@ -61,5 +62,4 @@ lazy val defaultClientSettings: Seq[Setting[_]] = Seq( """ ) - -Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-u", sys.env.getOrElse("SBT_JUNIT_OUTPUT", "junit")) +Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-u", s"test-results/scala-${scalaVersion.value}", "-o") \ No newline at end of file