Skip to content

Add unit tests to the JUnit xml report generation #6570

Add unit tests to the JUnit xml report generation

Add unit tests to the JUnit xml report generation #6570

Workflow file for this run

name: CI
# We run full CI on push builds to main and on all pull requests
#
# Tags are automatically published
#
# Manual builds (workflow_dispatch) to the main branch are also published
#
# To maximize bug-catching changes while keeping CI times reasonable, we run:
# - All tests on Linux/Java17
# - Fewer tests on Linux/Java8 and Windows/Java17
# - Fewest tests on Windows/Java8
on:
push:
branches:
- main
tags:
- '**'
pull_request:
merge_group:
workflow_dispatch:
# cancel older runs of a pull request;
# this will not cancel anything for normal git pushes
concurrency:
group: cancel-old-pr-runs-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
itest:
strategy:
fail-fast: false
matrix:
include:
# bootstrap tests
- java-version: 8
buildcmd: ci/test-mill-release.sh
- java-version: 17
buildcmd: ci/test-mill-release.sh
# Limit some tests to Java 17 to limit CI times
- java-version: 17
buildcmd: ci/test-mill-dev.sh
- java-version: 17
buildcmd: ci/test-mill-bootstrap.sh
# Have one job on latest JVM
- java-version: 20
buildcmd: ci/test-mill-bootstrap.sh
# Just some reporting to enable reasoning about library upgrades
- java-version: 8
buildcmd: |
./mill -i -k __.ivyDepsTree
./mill -i -k __.ivyDepsTree --withRuntime
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: ${{ matrix.java-version }}
buildcmd: ${{ matrix.buildcmd }}
linux:
strategy:
fail-fast: false
matrix:
java-version: [8, 17]
millargs:
# unit and module tests
- '"{main,scalalib,testrunner,bsp}.__.test"'
- '"scalajslib.__.test"'
- '"scalanativelib.__.test"'
# integration tests
- "integration.feature.__.server.test"
- "integration.feature.__.fork.test"
# contrib tests
- "contrib._.test"
include:
# Limit some tests to Java 17 to limit CI times
- java-version: 17
millargs: "example.__.local.test"
- java-version: 17
millargs: "integration.feature.__.local.test"
- java-version: 17
millargs: "integration.failure.__.test"
- java-version: 17
millargs: docs.githubPages
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: ${{ matrix.java-version }}
millargs: ${{ matrix.millargs }}
compiler-bridge:
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '8'
millargs: bridge.__.publishLocal
env-bridge-versions: 'essential'
format-check:
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '8'
millargs: mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources
scalafix-check:
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '8'
millargs: -i -k __.fix --check
bincompat-check:
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '8'
millargs: __.mimaReportBinaryIssues
continue-on-error: true
windows:
strategy:
fail-fast: false
matrix:
java-version: [8, 17]
millargs:
# Run a stripped down build matrix on Windows, to avoid taking too long
- '"{__.publishLocal,dev.assembly,__.compile}"'
- '"{main,scalalib,bsp}.__.test"'
- '"scalajslib.__.test"'
include:
# Limit some tests to Java 17 to limit CI times
- java-version: 17
# just run a subset of examples/ on Windows, because for some reason running
# the whole suite can take hours on windows v.s. half an hour on linux
millargs: '"example.basic.__.local.test"'
- java-version: 17
millargs: "integration.feature.__.fork.test"
- java-version: 17
millargs: "integration.feature.__.server.test"
- java-version: 17
millargs: "integration.failure.__.fork.test"
- java-version: 17
millargs: "contrib.__.test"
uses: ./.github/workflows/run-mill-action.yml
with:
os: windows-latest
java-version: ${{ matrix.java-version }}
millargs: ${{ matrix.millargs }}
publish-sonatype:
# when in master repo, publish all tags and manual runs on main
if: github.repository == 'com-lihaoyi/mill' && (startsWith( github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' ) )
needs: [linux, windows, compiler-bridge, format-check, bincompat-check, scalafix-check, itest]
runs-on: ubuntu-latest
# only run one publish job for the same sha at the same time
# e.g. when a main-branch push is also tagged
concurrency: publish-sonatype-${{ github.sha }}
env:
SONATYPE_PGP_SECRET: ${{ secrets.SONATYPE_PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_DEPLOY_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_DEPLOY_PASSWORD }}
SONATYPE_PGP_PASSWORD: ${{ secrets.SONATYPE_PGP_PASSWORD }}
LANG: "en_US.UTF-8"
LC_MESSAGES: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: temurin
- run: ci/release-maven.sh
release-github:
# when in master repo, publish all tags and manual runs on main
if: github.repository == 'com-lihaoyi/mill' && (startsWith( github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' ) )
needs: publish-sonatype
runs-on: ubuntu-latest
env:
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: temurin
- run: ./mill -i uploadToGithub $REPO_ACCESS_TOKEN