message: Only run the coverage build for macos-sync
diff: #!groovy
  +
  +@Library('realm-ci') _
  +
  def getSourceArchive() {
  deleteDir()
  unstash 'source'
  @@ -47,7 +50,7 @@ if (env.BRANCH_NAME == 'master') {
  env.DOCKER_PUSH = "1"
  }
  -def doDockerBuild(String flavor, Boolean withCoverage, Boolean enableSync, String sanitizerFlags = "") {
  +def doDockerBuild(String flavor, Boolean enableSync, String sanitizerFlags = "") {
  def sync = enableSync ? "sync" : ""
  def label = "${flavor}${enableSync ? '-sync' : ''}"
  @@ -57,18 +60,12 @@ def doDockerBuild(String flavor, Boolean withCoverage, Boolean enableSync, Strin
  def image = buildDockerEnv("ci/realm-object-store:${flavor}")
  sshagent(['realm-ci-ssh']) {
  image.inside("-v /etc/passwd:/etc/passwd:ro -v ${env.HOME}:${env.HOME} -v ${env.SSH_AUTH_SOCK}:${env.SSH_AUTH_SOCK} -e HOME=${env.HOME}") {
  - if(withCoverage) {
  - sh "rm -rf coverage.build ${label}.build && ./workflow/test_coverage.sh ${sync} && mv coverage.build ${label}.build"
  - echo "Stashing coverage-${label}"
  - stash includes: "${label}.build/coverage.xml", name: "coverage-${label}"
  - } else {
  sh "./workflow/build.sh ${flavor} ${sync} ${sanitizerFlags}"
  }
  }
  }
  }
  }
  -}
  def doAndroidDockerBuild() {
  return {
  @@ -165,10 +162,10 @@ stage('prepare') {
  stage('unit-tests') {
  parallel(
  - linux: doDockerBuild('linux', false, false),
  - linux_sync: doDockerBuild('linux', true, true),
  - linux_asan: doDockerBuild('linux', false, true, '-DSANITIZE_ADDRESS=1'),
  - linux_tsan: doDockerBuild('linux', false, true, '-DSANITIZE_THREAD=1'),
  + linux: doDockerBuild('linux', false),
  + linux_sync: doDockerBuild('linux', true),
  + linux_asan: doDockerBuild('linux', true, '-DSANITIZE_ADDRESS=1'),
  + linux_tsan: doDockerBuild('linux', true, '-DSANITIZE_THREAD=1'),
  android: doAndroidDockerBuild(),
  macos: doBuild('osx', 'macOS', false, ''),
  macos_sync: doBuild('osx', 'macOS', true, ''),
  @@ -184,7 +181,6 @@ stage('publish') {
  rlmCheckout(scm)
  // coverage reports assume sources are in the parent directory
  dir("build") {
  - publishCoverageReport('linux-sync')
  publishCoverageReport('macOS-sync')
  }
  }
  