Skip to content

Commit

Permalink
Merge pull request #1155 from guardian/add-test-report-to-workflow
Browse files Browse the repository at this point in the history
Add test report to workflows
  • Loading branch information
aracho1 authored Jul 10, 2024
2 parents 3be8548 + 8ee3298 commit 4ec4a2d
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/football.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ concurrency:
permissions:
id-token: write
contents: read
checks: write
pull-requests: write

jobs:
Expand All @@ -40,6 +41,16 @@ jobs:
- name: Compile, test and assembly
run: sbt "project api-models" "compile" "test" "project football" "compile" "test" "assembly"

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Tests
path: football/target/test-reports/TEST-*.xml
reporter: java-junit
only-summary: 'false'
fail-on-error: 'true'

- name: Copy jar to root
run: cp football/target/scala-*/football.jar .

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/notification-worker-lambdas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concurrency:
permissions:
id-token: write
contents: read
checks: write
pull-requests: write

jobs:
Expand Down Expand Up @@ -53,6 +54,16 @@ jobs:
- name: Compile and test
run: sbt "project common" "compile" "test" "project notificationworkerlambda" "compile" "test"

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Tests
path: notificationworkerlambda/target/test-reports/TEST-*.xml
reporter: java-junit
only-summary: 'false'
fail-on-error: 'true'

- name: Build docker image
run: sbt docker:publishLocal

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concurrency:
permissions:
id-token: write
contents: read
checks: write
pull-requests: write

jobs:
Expand All @@ -42,6 +43,16 @@ jobs:
- name: Compile, test and package
run: sbt "project common" "compile" "test" "project commonscheduledynamodb" "compile" "test" "project notification" "compile" "test" "debian:packageBin"

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Tests
path: notification/target/test-reports/TEST-*.xml
reporter: java-junit
only-summary: 'false'
fail-on-error: 'true'

- name: Upload to riff-raff
uses: guardian/actions-riff-raff@v4
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/registration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ concurrency:
permissions:
id-token: write
contents: read
checks: write
pull-requests: write

jobs:
Expand Down Expand Up @@ -57,6 +58,16 @@ jobs:
- name: Compile, test and package
run: sbt "project common" "compile" "test" "project registration" "compile" "test" "debian:packageBin"

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Tests
path: registration/target/test-reports/TEST-*.xml
reporter: java-junit
only-summary: 'false'
fail-on-error: 'true'

- name: Upload to riff-raff
uses: guardian/actions-riff-raff@v4
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concurrency:
permissions:
id-token: write
contents: read
checks: write
pull-requests: write

jobs:
Expand All @@ -42,6 +43,16 @@ jobs:
- name: Compile, test and package
run: sbt "project common" "compile" "test" "project report" "compile" "test" "debian:packageBin"

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Tests
path: report/target/test-reports/TEST-*.xml
reporter: java-junit
only-summary: 'false'
fail-on-error: 'true'

- name: Upload to riff-raff
uses: guardian/actions-riff-raff@v4
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/schedule-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ concurrency:
permissions:
id-token: write
contents: read
checks: write
pull-requests: write

jobs:
Expand All @@ -40,6 +41,16 @@ jobs:
- name: Compile, test and assembly
run: sbt "project commonscheduledynamodb" "compile" "test" "project schedule" "compile" "test" "assembly"

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Tests
path: schedulelambda/target/test-reports/TEST-*.xml
reporter: java-junit
only-summary: 'false'
fail-on-error: 'true'

- name: Copy jar to root
run: cp schedulelambda/target/scala-*/schedule.jar .

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/slo-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ concurrency:
permissions:
id-token: write
contents: read
checks: write
pull-requests: write

jobs:
Expand Down Expand Up @@ -47,6 +48,16 @@ jobs:
- name: Compile, test and assembly
run: sbt "project commoneventconsumer" "compile" "test" "project slomonitor" "compile" "test" "assembly"

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Tests
path: slomonitor/target/test-reports/TEST-*.xml
reporter: java-junit
only-summary: 'false'
fail-on-error: 'true'

- name: Copy jar to root
run: cp slomonitor/target/scala-*/slomonitor.jar .

Expand Down
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ val standardSettings = Seq[Setting[_]](
"org.specs2" %% "specs2-matcher-extra" % specsVersion % Test
),
// Workaround Mockito causes deadlock on SBT classloaders: https://github.com/sbt/sbt/issues/3022
Test / parallelExecution := false
Test / parallelExecution := false,
Test / testOptions += Tests.Argument(TestFrameworks.Specs2, "junitxml", "console")
)

lazy val commoneventconsumer = project
Expand Down

0 comments on commit 4ec4a2d

Please sign in to comment.