Skip to content

Commit

Permalink
Generate test reports on the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Gedochao committed Nov 15, 2023
1 parent 694877c commit 77bf110
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 0 deletions.
168 changes: 168 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ jobs:
run: ./mill -i __.compile
- name: Unit tests
run: ./mill -i unitTests
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc unit-tests 'Scala CLI Unit Tests' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-unit-tests
path: test-report.xml

jvm-tests-1:
timeout-minutes: 120
Expand All @@ -59,6 +67,14 @@ jobs:
SCALA_CLI_IT_GROUP: 1
- name: Fat jar integration test
run: ./mill integration.test.jvmBootstrapped 'scala.cli.integration.StandaloneLauncherTests.*'
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc jvm-tests-1 'Scala CLI JVM Tests (1)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-jvm-tests-1
path: test-report.xml

jvm-tests-2:
timeout-minutes: 120
Expand All @@ -75,6 +91,14 @@ jobs:
run: ./mill -i integration.test.jvm
env:
SCALA_CLI_IT_GROUP: 2
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc jvm-tests-2 'Scala CLI JVM Tests (2)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-jvm-tests-2
path: test-report.xml

jvm-tests-3:
timeout-minutes: 120
Expand All @@ -91,6 +115,14 @@ jobs:
run: ./mill -i integration.test.jvm
env:
SCALA_CLI_IT_GROUP: 3
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc jvm-tests-3 'Scala CLI JVM Tests (3)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-jvm-tests-3
path: test-report.xml

generate-linux-launcher:
timeout-minutes: 120
Expand Down Expand Up @@ -141,6 +173,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 1
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc linux-tests-1 'Scala CLI Linux Tests (1)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-linux-tests-1
path: test-report.xml

native-linux-tests-2:
needs: generate-linux-launcher
Expand All @@ -165,6 +205,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 2
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc linux-tests-2 'Scala CLI Linux Tests (2)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-linux-tests-2
path: test-report.xml

native-linux-tests-3:
needs: generate-linux-launcher
Expand All @@ -189,6 +237,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 3
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc linux-tests-3 'Scala CLI Linux Tests (3)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-linux-tests-3
path: test-report.xml

generate-linux-arm64-native-launcher:
runs-on: "macOS-m1"
Expand Down Expand Up @@ -262,6 +318,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 1
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc macos-tests-1 'Scala CLI MacOS Tests (1)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-macos-tests-1
path: test-report.xml

native-macos-tests-2:
needs: generate-macos-launcher
Expand All @@ -286,6 +350,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 2
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc macos-tests-2 'Scala CLI MacOS Tests (2)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-macos-tests-2
path: test-report.xml

native-macos-tests-3:
needs: generate-macos-launcher
Expand All @@ -310,6 +382,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 3
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc macos-tests-3 'Scala CLI MacOS Tests (3)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-macos-tests-3
path: test-report.xml

generate-macos-m1-launcher:
timeout-minutes: 120
Expand Down Expand Up @@ -363,6 +443,14 @@ jobs:
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc macos-m1-tests 'Scala CLI MacOS M1 Tests' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-macos-m1-tests
path: test-report.xml

generate-windows-launcher:
timeout-minutes: 120
Expand Down Expand Up @@ -426,6 +514,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 1
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: scala-cli shebang .github/scripts/generate-junit-reports.sc windows-tests-1 'Scala CLI Windows Tests (1)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-windows-tests-1
path: test-report.xml

native-windows-tests-2:
needs: generate-windows-launcher
Expand Down Expand Up @@ -458,6 +554,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 2
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: scala-cli shebang .github/scripts/generate-junit-reports.sc windows-tests-2 'Scala CLI Windows Tests (2)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-windows-tests-2
path: test-report.xml

native-windows-tests-3:
needs: generate-windows-launcher
Expand Down Expand Up @@ -490,6 +594,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 3
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: scala-cli shebang .github/scripts/generate-junit-reports.sc windows-tests-3 'Scala CLI Windows Tests (3)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-windows-tests-3
path: test-report.xml

generate-mostly-static-launcher:
timeout-minutes: 120
Expand Down Expand Up @@ -541,6 +653,14 @@ jobs:
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Docker integration tests
run: ./mill integration.docker-slim.test
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc native-mostly-static-tests-1 'Scala CLI Native Mostly Static Tests (1)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-native-mostly-static-tests-1
path: test-report.xml
- name: Login to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v3
Expand Down Expand Up @@ -574,6 +694,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 2
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc native-mostly-static-tests-2 'Scala CLI Native Mostly Static Tests (2)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-native-mostly-static-tests-2
path: test-report.xml

native-mostly-static-tests-3:
needs: generate-mostly-static-launcher
Expand All @@ -598,6 +726,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 3
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc native-mostly-static-tests-3 'Scala CLI Native Mostly Static Tests (3)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-native-mostly-static-tests-3
path: test-report.xml

generate-static-launcher:
timeout-minutes: 120
Expand Down Expand Up @@ -649,6 +785,14 @@ jobs:
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Docker integration tests
run: ./mill integration.docker.test
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc native-static-tests-1 'Scala CLI Native Static Tests (1)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-native-static-tests-1
path: test-report.xml
- name: Login to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v3
Expand Down Expand Up @@ -684,6 +828,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 2
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc native-static-tests-2 'Scala CLI Native Static Tests (2)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-native-static-tests-2
path: test-report.xml

native-static-tests-3:
needs: generate-static-launcher
Expand All @@ -710,6 +862,14 @@ jobs:
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
SCALA_CLI_IT_GROUP: 3
SCALA_CLI_SODIUM_JNI_ALLOW: false
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc native-static-tests-3 'Scala CLI Native Static Tests (3)' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-native-static-tests-3
path: test-report.xml

docs-tests:
# for now, let's run those tests only on ubuntu
Expand All @@ -729,6 +889,14 @@ jobs:
run: .github/scripts/build-website.sh
- name: Test documentation
run: ./mill -i docs-tests.test
- name: Convert Mill test reports to JUnit XML format
run: .github/scripts/generate-junit-reports.sc docs-tests 'Scala CLI Docs Tests' test-report.xml out/
- name: Upload test report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-docs-tests
path: test-report.xml

checks:
timeout-minutes: 15
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Test Report'
on:
workflow_run:
workflows: ['CI']
types:
- completed
permissions:
statuses: write
checks: write
contents: write
pull-requests: write
actions: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: /test-results-(.*)/
name: 'Test report $1'
path: '*.xml'
reporter: java-junit

0 comments on commit 77bf110

Please sign in to comment.