Skip to content

Commit

Permalink
Merge pull request #417 from guardian/db-rt/adjust-test-results
Browse files Browse the repository at this point in the history
Various CI fixes, including avoiding `push` as a CI trigger
  • Loading branch information
Divs-B authored Apr 19, 2024
2 parents 2a09247 + 0e4149e commit 088362d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/testonpush.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ lazy val root = (project in file("."))
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
Expand Down Expand Up @@ -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")

0 comments on commit 088362d

Please sign in to comment.