From d97b9ce943d9d7885e1861b8e71e14573f122b1a Mon Sep 17 00:00:00 2001 From: Daniel Spiewak Date: Tue, 3 Nov 2020 16:57:42 -0700 Subject: [PATCH 1/4] Attempting to move the build to github actions --- .github/workflows/ci.yml | 250 +++++++++++++++++++++++++++ .github/workflows/clean.yml | 59 +++++++ .gitignore | 3 + .travis.yml | 90 ---------- build.sbt | 88 +++++++++- examples/scalajs/project/plugins.sbt | 1 + project/plugin.sbt | 2 + tools/travis-script.sh | 6 + 8 files changed, 406 insertions(+), 93 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/clean.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..ca3c5c632 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,250 @@ +# This file was automatically generated by sbt-github-actions using the +# githubWorkflowGenerate task. You should add and commit this file to +# your git repository. It goes without saying that you shouldn't edit +# this file by hand! Instead, if you wish to make changes, you should +# change your sbt build configuration to revise the workflow description +# to meet your needs, then regenerate this file. + +name: Continuous Integration + +on: + pull_request: + branches: ['*'] + push: + branches: ['*'] + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + build: + name: Build and Test + strategy: + matrix: + os: [ubuntu-latest] + scala: [0.27.0-RC1, 3.0.0-M1, 2.11.12, 2.12.10, 2.13.3] + java: [adopt@1.8, adopt@1.11] + platform: [jvm] + include: + - os: ubuntu-latest + java: adopt@1.8 + scala: 0.27.0-RC1 + platform: js + pluginversion: 1.3.0 + - os: ubuntu-latest + java: adopt@1.8 + scala: 3.0.0-M1 + platform: js + pluginversion: 1.3.0 + - os: ubuntu-latest + java: adopt@1.8 + scala: 2.12.10 + platform: js + pluginversion: 1.3.0 + - os: ubuntu-latest + java: adopt@1.8 + scala: 2.13.3 + platform: js + pluginversion: 1.3.0 + - os: ubuntu-latest + java: adopt@1.8 + scala: 2.11.12 + platform: js + pluginversion: 0.6.33 + - os: ubuntu-latest + java: adopt@1.8 + scala: 2.11.12 + platform: native + pluginversion: 0.3.9 + - os: ubuntu-latest + java: adopt@1.8 + scala: 2.11.12 + platform: native + pluginversion: 0.4.0-M2 + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java and Scala + uses: olafurpg/setup-scala@v10 + with: + java-version: ${{ matrix.java }} + + - name: Cache ivy2 + uses: actions/cache@v1 + with: + path: ~/.ivy2/cache + key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (generic) + uses: actions/cache@v1 + with: + path: ~/.coursier/cache/v1 + key: ${{ runner.os }}-generic-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (linux) + if: contains(runner.os, 'linux') + uses: actions/cache@v1 + with: + path: ~/.cache/coursier/v1 + key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (macOS) + if: contains(runner.os, 'macos') + uses: actions/cache@v1 + with: + path: ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (windows) + if: contains(runner.os, 'windows') + uses: actions/cache@v1 + with: + path: ~/AppData/Local/Coursier/Cache/v1 + key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache sbt + uses: actions/cache@v1 + with: + path: ~/.sbt + key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Setup scala native dependencies + if: matrix.platform == 'native' + run: sudo apt install clang libunwind-dev libgc-dev libre2-dev + + - name: Check that workflows are up to date + run: sbt ++${{ matrix.scala }} githubWorkflowCheck + + - name: Run the build script + env: + PLATFORM: ${{ matrix.platform }} + PLUGIN_VERSION: ${{ matrix.pluginversion }} + run: ./tools/travis-script.sh + + examples: + name: Examples + strategy: + matrix: + os: [ubuntu-latest] + scala: [2.13.3] + java: [adopt@1.8] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java and Scala + uses: olafurpg/setup-scala@v10 + with: + java-version: ${{ matrix.java }} + + - name: Cache ivy2 + uses: actions/cache@v1 + with: + path: ~/.ivy2/cache + key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (generic) + uses: actions/cache@v1 + with: + path: ~/.coursier/cache/v1 + key: ${{ runner.os }}-generic-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (linux) + if: contains(runner.os, 'linux') + uses: actions/cache@v1 + with: + path: ~/.cache/coursier/v1 + key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (macOS) + if: contains(runner.os, 'macos') + uses: actions/cache@v1 + with: + path: ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (windows) + if: contains(runner.os, 'windows') + uses: actions/cache@v1 + with: + path: ~/AppData/Local/Coursier/Cache/v1 + key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache sbt + uses: actions/cache@v1 + with: + path: ~/.sbt + key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Build examples + run: | + cd examples + for d in */ ; do cd "$d" && sbt test:compile && cd ../ ; done + + bench: + name: Bench + strategy: + matrix: + os: [ubuntu-latest] + scala: [0.27.0-RC1, 3.0.0-M1, 2.11.12, 2.12.10, 2.13.3] + java: [adopt@1.8] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java and Scala + uses: olafurpg/setup-scala@v10 + with: + java-version: ${{ matrix.java }} + + - name: Cache ivy2 + uses: actions/cache@v1 + with: + path: ~/.ivy2/cache + key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (generic) + uses: actions/cache@v1 + with: + path: ~/.coursier/cache/v1 + key: ${{ runner.os }}-generic-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (linux) + if: contains(runner.os, 'linux') + uses: actions/cache@v1 + with: + path: ~/.cache/coursier/v1 + key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (macOS) + if: contains(runner.os, 'macos') + uses: actions/cache@v1 + with: + path: ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache coursier (windows) + if: contains(runner.os, 'windows') + uses: actions/cache@v1 + with: + path: ~/AppData/Local/Coursier/Cache/v1 + key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Cache sbt + uses: actions/cache@v1 + with: + path: ~/.sbt + key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Run dubious benchmark suite + run: 'sbt ++${{ matrix.scala }} ''bench/jmh:run -p genSize=0 -p seedCount=0 -bs 1 -wi 0 -i 1 -f 0 -t 1 -r 0 org.scalacheck.bench.GenBench''' \ No newline at end of file diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml new file mode 100644 index 000000000..b535fcc18 --- /dev/null +++ b/.github/workflows/clean.yml @@ -0,0 +1,59 @@ +# This file was automatically generated by sbt-github-actions using the +# githubWorkflowGenerate task. You should add and commit this file to +# your git repository. It goes without saying that you shouldn't edit +# this file by hand! Instead, if you wish to make changes, you should +# change your sbt build configuration to revise the workflow description +# to meet your needs, then regenerate this file. + +name: Clean + +on: push + +jobs: + delete-artifacts: + name: Delete Artifacts + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Delete artifacts + run: | + # Customize those three lines with your repository and credentials: + REPO=${GITHUB_API_URL}/repos/${{ github.repository }} + + # A shortcut to call GitHub API. + ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; } + + # A temporary file which receives HTTP response headers. + TMPFILE=/tmp/tmp.$$ + + # An associative array, key: artifact name, value: number of artifacts of that name. + declare -A ARTCOUNT + + # Process all artifacts on this repository, loop on returned "pages". + URL=$REPO/actions/artifacts + while [[ -n "$URL" ]]; do + + # Get current page, get response headers in a temporary file. + JSON=$(ghapi --dump-header $TMPFILE "$URL") + + # Get URL of next page. Will be empty if we are at the last page. + URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*.*//') + rm -f $TMPFILE + + # Number of artifacts on this page: + COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') )) + + # Loop on all artifacts on this page. + for ((i=0; $i < $COUNT; i++)); do + + # Get name of artifact and count instances of this name. + name=$(jq <<<$JSON -r ".artifacts[$i].name?") + ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1)) + + id=$(jq <<<$JSON -r ".artifacts[$i].id?") + size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") )) + printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size + ghapi -X DELETE $REPO/actions/artifacts/$id + done + done \ No newline at end of file diff --git a/.gitignore b/.gitignore index f4f29c71c..a00773b35 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ target/ # Intellij .idea + +# bloop +/.bsp/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2b1d0ead6..000000000 --- a/.travis.yml +++ /dev/null @@ -1,90 +0,0 @@ -language: scala -script: ./tools/travis-script.sh -after_success: ./tools/travis-deploy.sh -branches: - only: - - master - - 1.14.x - - 1.15.x -notifications: - email: - - rickynils@gmail.com - - seth.tisue@lightbend.com - -scala: - - 2.11.12 - - 2.12.10 - - 2.13.3 -jdk: - - openjdk8 - - openjdk11 -env: - global: - - secure: PwIb1un8vuuyoidnjHaKO81FD49n5ZTVEnf6hVKkMRe3hipr+WGWv19m92yE/n34ROFo1BM9DmfYxaexlE0pI2o/a5MV1i3kNSwUk+Yt8uU6F4+nyQKROQUe76UtAtXmsYgLqXaWSW0+EVidMyhSktkXXxiU5wCGLdKkPu3Vj9w= - - secure: KeZRD91oE4UzwhSJfjllkwNXnerDGQJSIOuRLVtbLCq0JJnAfj6B7fvI2KyZqQwuhYrUyYOSbSLd6BAi75bBYMb3D1yNdyPA5gHDg5aj96ALojrOuU60+/dOQ0Rg6Pf2UiTlFAXzz1mud8+Q3svaeKX4JDVxj329T3ReBspjyBY= - matrix: - - PLATFORM=jvm SBT_PARALLEL=true WORKERS=4 DEPLOY=false - - PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=false - - PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=false SCALAJS_VERSION=0.6.33 - - PLATFORM=jvm SBT_PARALLEL=true WORKERS=4 DEPLOY=true - - PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=true - - PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=true SCALAJS_VERSION=0.6.33 -dist: xenial - -before_cache: - - rm -fv $HOME/.ivy2/.sbt.ivy.lock - - find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete - - find $HOME/.sbt -name "*.lock" -print -delete - -cache: - directories: - - $HOME/.ivy2/cache - - $HOME/.sbt - - $HOME/.cache/coursier - -matrix: - include: - - scala: 2.11.12 - before_script: - - curl https://raw.githubusercontent.com/scala-native/scala-native/master/scripts/travis_setup.sh | bash -x - env: PLATFORM=native SBT_PARALLEL=true WORKERS=1 DEPLOY=true - - scala: 2.11.12 - before_script: - - curl https://raw.githubusercontent.com/scala-native/scala-native/master/scripts/travis_setup.sh | bash -x - env: PLATFORM=native SBT_PARALLEL=true SCALANATIVE_VERSION="0.4.0-M2" WORKERS=1 DEPLOY=true - - env: EXAMPLES - script: - - cd examples - - for d in */ ; do cd "$d" && sbt test:compile && cd ../ ; done - - env: BENCH - script: - - sbt "+bench/jmh:run -p genSize=0 -p seedCount=0 -bs 1 -wi 0 -i 1 -f 0 -t 1 -r 0 org.scalacheck.bench.GenBench" - - scala: 0.27.0-RC1 - env: PLATFORM=jvm SBT_PARALLEL=true WORKERS=1 DEPLOY=true - exclude: - - jdk: openjdk8 - env: PLATFORM=jvm SBT_PARALLEL=true WORKERS=4 DEPLOY=false - - jdk: openjdk8 - env: PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=false - - jdk: openjdk8 - env: PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=false SCALAJS_VERSION=0.6.33 - - jdk: openjdk11 - env: PLATFORM=jvm SBT_PARALLEL=true WORKERS=4 DEPLOY=true - - jdk: openjdk11 - env: PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=true - - jdk: openjdk11 - env: PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=true SCALAJS_VERSION=0.6.33 - - scala: 2.11.12 - env: PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=false SCALAJS_VERSION=0.6.33 - - scala: 2.11.12 - env: PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=true SCALAJS_VERSION=0.6.33 - - jdk: openjdk11 - env: PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=false - - jdk: openjdk11 - env: PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=true - - jdk: openjdk11 - env: PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=false SCALAJS_VERSION=0.6.33 - - jdk: openjdk11 - env: PLATFORM=js SBT_PARALLEL=true WORKERS=1 DEPLOY=true SCALAJS_VERSION=0.6.33 - - jdk: openjdk11 - scala: 2.11.12 diff --git a/build.sbt b/build.sbt index f4369f659..94f3f3d5b 100644 --- a/build.sbt +++ b/build.sbt @@ -4,6 +4,89 @@ val scalaMajorVersion = SettingKey[Int]("scalaMajorVersion") scalaVersionSettings +val Scala211 = "2.11.12" +val Scala212 = "2.12.10" +val Scala213 = "2.13.3" +val DottyOld = "0.27.0-RC1" +val DottyNew = "3.0.0-M1" + +ThisBuild / scalaVersion := Scala213 +ThisBuild / crossScalaVersions := Seq(DottyOld, DottyNew, Scala211, Scala212, scalaVersion.value) + +ThisBuild / githubWorkflowPublishTargetBranches := Seq() + +val PrimaryOS = "ubuntu-latest" +ThisBuild / githubWorkflowOSes := Seq(PrimaryOS) + +val Java8 = "adopt@1.8" + +ThisBuild / githubWorkflowJavaVersions := Seq(Java8, "adopt@1.11") + +// we don't need this since we aren't publishing +ThisBuild / githubWorkflowArtifactUpload := false + +ThisBuild / githubWorkflowBuildMatrixAdditions += + "platform" -> List("jvm") + +ThisBuild / githubWorkflowBuildMatrixInclusions ++= + crossScalaVersions.value.filterNot(Set(Scala211)) map { scala => + MatrixInclude( + Map("os" -> PrimaryOS, "java" -> Java8, "scala" -> scala), + Map("platform" -> "js", "pluginversion" -> "1.3.0")) + } + +ThisBuild / githubWorkflowBuildMatrixInclusions += + MatrixInclude( + Map("os" -> PrimaryOS, "java" -> Java8, "scala" -> Scala211), + Map("platform" -> "js", "pluginversion" -> "0.6.33")) + +ThisBuild / githubWorkflowBuildMatrixInclusions ++= + Seq("0.3.9", "0.4.0-M2") map { v => + MatrixInclude( + Map( + "os" -> PrimaryOS, + "scala" -> Scala211, + "java" -> Java8), + Map("platform" -> "native", "pluginversion" -> v)) + } + +ThisBuild / githubWorkflowBuildPreamble += + WorkflowStep.Run( + List("sudo apt install clang libunwind-dev libgc-dev libre2-dev"), + name = Some("Setup scala native dependencies"), + cond = Some("matrix.platform == 'native'")) + +ThisBuild / githubWorkflowBuild := Seq( + WorkflowStep.Run( + List("./tools/travis-script.sh"), + name = Some("Run the build script"), + env = Map( + "PLATFORM" -> "${{ matrix.platform }}", + "PLUGIN_VERSION" -> "${{ matrix.pluginversion }}"))) + +ThisBuild / githubWorkflowAddedJobs ++= Seq( + WorkflowJob( + "examples", + "Examples", + githubWorkflowJobSetup.value.toList ::: List( + WorkflowStep.Run( + List( + "cd examples", + "for d in */ ; do cd \"$d\" && sbt test:compile && cd ../ ; done"), + name = Some("Build examples"))), + javas = List(Java8), + scalas = List(scalaVersion.value)), + + WorkflowJob( + "bench", + "Bench", + githubWorkflowJobSetup.value.toList ::: List( + WorkflowStep.Sbt( + List("bench/jmh:run -p genSize=0 -p seedCount=0 -bs 1 -wi 0 -i 1 -f 0 -t 1 -r 0 org.scalacheck.bench.GenBench"), + name = Some("Run dubious benchmark suite"))), + javas = List(Java8), + scalas = crossScalaVersions.value.toList)) + lazy val versionNumber = "1.15.1" def env(name: String): Option[String] = @@ -14,8 +97,6 @@ val isRelease = env("IS_RELEASE").exists(_ == "true") lazy val travisCommit = env("TRAVIS_COMMIT") lazy val scalaVersionSettings = Seq( - scalaVersion := "2.13.3", - crossScalaVersions := Seq("2.11.12", "2.12.10", scalaVersion.value), scalaMajorVersion := { val v = scalaVersion.value CrossVersion.partialVersion(v).map(_._2.toInt).getOrElse { @@ -161,7 +242,8 @@ lazy val js = project.in(file("js")) .settings(sharedSettings: _*) .settings( Global / scalaJSStage := FastOptStage, - libraryDependencies += "org.scala-js" %% "scalajs-test-interface" % scalaJSVersion + libraryDependencies += + ("org.scala-js" %% "scalajs-test-interface" % scalaJSVersion).withDottyCompat(scalaVersion.value) ) .enablePlugins(ScalaJSPlugin) diff --git a/examples/scalajs/project/plugins.sbt b/examples/scalajs/project/plugins.sbt index 1a1034041..f1fc1d79f 100644 --- a/examples/scalajs/project/plugins.sbt +++ b/examples/scalajs/project/plugins.sbt @@ -1 +1,2 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0") + diff --git a/project/plugin.sbt b/project/plugin.sbt index 08eadd40e..4bce89373 100644 --- a/project/plugin.sbt +++ b/project/plugin.sbt @@ -31,3 +31,5 @@ val scalaNativeVersion = env("SCALANATIVE_VERSION") match { addSbtPlugin("org.scala-native" % "sbt-scala-native" % scalaNativeVersion) addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.0") + +addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.9.4") diff --git a/tools/travis-script.sh b/tools/travis-script.sh index e9d6f9cd2..ef2ba06af 100755 --- a/tools/travis-script.sh +++ b/tools/travis-script.sh @@ -1,6 +1,12 @@ #!/bin/bash set -evu +if [[ "$PLATFORM" == "js" ]]; then + export SCALAJS_VERSION="$PLUGIN_VERSION" +else + export SCALANATIVE_VERSION="$PLUGIN_VERSION" +fi + sbt_cmd=(sbt ++$TRAVIS_SCALA_VERSION) if [[ "$PLATFORM" == "js" ]]; then From e4bc006588fdef1828c1e88b2e70dca36b4aa02e Mon Sep 17 00:00:00 2001 From: Daniel Spiewak Date: Tue, 3 Nov 2020 17:21:17 -0700 Subject: [PATCH 2/4] Fixed build configuration to avoid conditional references --- .github/workflows/ci.yml | 8 +++----- build.sbt | 16 +++++++++------- project/plugin.sbt | 4 ++-- tools/travis-script.sh | 2 -- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca3c5c632..f5c8c973d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,17 +25,13 @@ jobs: scala: [0.27.0-RC1, 3.0.0-M1, 2.11.12, 2.12.10, 2.13.3] java: [adopt@1.8, adopt@1.11] platform: [jvm] + workers: [1, 4] include: - os: ubuntu-latest java: adopt@1.8 scala: 0.27.0-RC1 platform: js pluginversion: 1.3.0 - - os: ubuntu-latest - java: adopt@1.8 - scala: 3.0.0-M1 - platform: js - pluginversion: 1.3.0 - os: ubuntu-latest java: adopt@1.8 scala: 2.12.10 @@ -123,6 +119,8 @@ jobs: env: PLATFORM: ${{ matrix.platform }} PLUGIN_VERSION: ${{ matrix.pluginversion }} + TRAVIS_SCALA_VERSION: ${{ matrix.scala }} + WORKERS: ${{ matrix.workers }} run: ./tools/travis-script.sh examples: diff --git a/build.sbt b/build.sbt index 94f3f3d5b..6a3077d83 100644 --- a/build.sbt +++ b/build.sbt @@ -10,8 +10,8 @@ val Scala213 = "2.13.3" val DottyOld = "0.27.0-RC1" val DottyNew = "3.0.0-M1" -ThisBuild / scalaVersion := Scala213 -ThisBuild / crossScalaVersions := Seq(DottyOld, DottyNew, Scala211, Scala212, scalaVersion.value) +ThisBuild / crossScalaVersions := Seq(DottyOld, DottyNew, Scala211, Scala212, Scala213) +ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.last ThisBuild / githubWorkflowPublishTargetBranches := Seq() @@ -25,11 +25,11 @@ ThisBuild / githubWorkflowJavaVersions := Seq(Java8, "adopt@1.11") // we don't need this since we aren't publishing ThisBuild / githubWorkflowArtifactUpload := false -ThisBuild / githubWorkflowBuildMatrixAdditions += - "platform" -> List("jvm") +ThisBuild / githubWorkflowBuildMatrixAdditions += "platform" -> List("jvm") +ThisBuild / githubWorkflowBuildMatrixAdditions += "workers" -> List("1", "4") ThisBuild / githubWorkflowBuildMatrixInclusions ++= - crossScalaVersions.value.filterNot(Set(Scala211)) map { scala => + crossScalaVersions.value.filterNot(Set(Scala211, DottyNew)) map { scala => MatrixInclude( Map("os" -> PrimaryOS, "java" -> Java8, "scala" -> scala), Map("platform" -> "js", "pluginversion" -> "1.3.0")) @@ -62,7 +62,9 @@ ThisBuild / githubWorkflowBuild := Seq( name = Some("Run the build script"), env = Map( "PLATFORM" -> "${{ matrix.platform }}", - "PLUGIN_VERSION" -> "${{ matrix.pluginversion }}"))) + "PLUGIN_VERSION" -> "${{ matrix.pluginversion }}", + "TRAVIS_SCALA_VERSION" -> "${{ matrix.scala }}", + "WORKERS" -> "${{ matrix.workers }}"))) ThisBuild / githubWorkflowAddedJobs ++= Seq( WorkflowJob( @@ -75,7 +77,7 @@ ThisBuild / githubWorkflowAddedJobs ++= Seq( "for d in */ ; do cd \"$d\" && sbt test:compile && cd ../ ; done"), name = Some("Build examples"))), javas = List(Java8), - scalas = List(scalaVersion.value)), + scalas = List(crossScalaVersions.value.last)), WorkflowJob( "bench", diff --git a/project/plugin.sbt b/project/plugin.sbt index 4bce89373..9cd8a3aec 100644 --- a/project/plugin.sbt +++ b/project/plugin.sbt @@ -15,7 +15,7 @@ def printAndDie(msg: String): Nothing = { // Update SCALAJS_VERSION in release.sh, as well val scalaJSVersion = env("SCALAJS_VERSION") match { case Some("0.6.33") => "0.6.33" - case Some("1.3.0") | None => "1.3.0" + case Some("1.3.0") | Some("") | None => "1.3.0" case Some(v) => printAndDie(s"unsupported scala.js version: $v") } @@ -23,7 +23,7 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion) // Update SCALANATIVE_VERSION in release.sh, as well val scalaNativeVersion = env("SCALANATIVE_VERSION") match { - case Some("0.3.9") | None => "0.3.9" + case Some("0.3.9") | Some("") | None => "0.3.9" case Some("0.4.0-M2") => "0.4.0-M2" case Some(v) => printAndDie(s"unsupported scala native version: $v") } diff --git a/tools/travis-script.sh b/tools/travis-script.sh index ef2ba06af..1be1199f8 100755 --- a/tools/travis-script.sh +++ b/tools/travis-script.sh @@ -15,8 +15,6 @@ else TESTS=1000 fi -sbt_cmd+=("set ThisBuild / parallelExecution := $SBT_PARALLEL") - for t in clean compile "testOnly * -- -s $TESTS -w $WORKERS" mimaReportBinaryIssues package; do sbt_cmd+=("$PLATFORM/$t") done From e7e781ae9c5008b84526162f9c094fb203005cf4 Mon Sep 17 00:00:00 2001 From: Daniel Spiewak Date: Tue, 3 Nov 2020 18:42:55 -0700 Subject: [PATCH 3/4] Fixed worker stuff in matrix inclusions --- .github/workflows/ci.yml | 18 ++++++++++++------ build.sbt | 6 +++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5c8c973d..f9ceefb31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,32 +27,38 @@ jobs: platform: [jvm] workers: [1, 4] include: - - os: ubuntu-latest + - workers: 1 + os: ubuntu-latest java: adopt@1.8 scala: 0.27.0-RC1 platform: js pluginversion: 1.3.0 - - os: ubuntu-latest + - workers: 1 + os: ubuntu-latest java: adopt@1.8 scala: 2.12.10 platform: js pluginversion: 1.3.0 - - os: ubuntu-latest + - workers: 1 + os: ubuntu-latest java: adopt@1.8 scala: 2.13.3 platform: js pluginversion: 1.3.0 - - os: ubuntu-latest + - workers: 1 + os: ubuntu-latest java: adopt@1.8 scala: 2.11.12 platform: js pluginversion: 0.6.33 - - os: ubuntu-latest + - workers: 1 + os: ubuntu-latest java: adopt@1.8 scala: 2.11.12 platform: native pluginversion: 0.3.9 - - os: ubuntu-latest + - workers: 1 + os: ubuntu-latest java: adopt@1.8 scala: 2.11.12 platform: native diff --git a/build.sbt b/build.sbt index 6a3077d83..9edfc450b 100644 --- a/build.sbt +++ b/build.sbt @@ -32,13 +32,13 @@ ThisBuild / githubWorkflowBuildMatrixInclusions ++= crossScalaVersions.value.filterNot(Set(Scala211, DottyNew)) map { scala => MatrixInclude( Map("os" -> PrimaryOS, "java" -> Java8, "scala" -> scala), - Map("platform" -> "js", "pluginversion" -> "1.3.0")) + Map("platform" -> "js", "pluginversion" -> "1.3.0", "workers" -> "1")) } ThisBuild / githubWorkflowBuildMatrixInclusions += MatrixInclude( Map("os" -> PrimaryOS, "java" -> Java8, "scala" -> Scala211), - Map("platform" -> "js", "pluginversion" -> "0.6.33")) + Map("platform" -> "js", "pluginversion" -> "0.6.33", "workers" -> "1")) ThisBuild / githubWorkflowBuildMatrixInclusions ++= Seq("0.3.9", "0.4.0-M2") map { v => @@ -47,7 +47,7 @@ ThisBuild / githubWorkflowBuildMatrixInclusions ++= "os" -> PrimaryOS, "scala" -> Scala211, "java" -> Java8), - Map("platform" -> "native", "pluginversion" -> v)) + Map("platform" -> "native", "pluginversion" -> v, "workers" -> "1")) } ThisBuild / githubWorkflowBuildPreamble += From fa8a2afdbcca48df964127c0771683419febef0a Mon Sep 17 00:00:00 2001 From: Lars Hupel Date: Fri, 6 Nov 2020 08:47:14 +0100 Subject: [PATCH 4/4] remove old workflow files --- .github/workflows/bench.yml | 38 -------------- .github/workflows/examples.yml | 40 --------------- .github/workflows/scala.yml | 84 ------------------------------- .github/workflows/scalanative.yml | 67 ------------------------ 4 files changed, 229 deletions(-) delete mode 100644 .github/workflows/bench.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/scala.yml delete mode 100644 .github/workflows/scalanative.yml diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml deleted file mode 100644 index c3f045038..000000000 --- a/.github/workflows/bench.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Bench CI - -on: - push: - branches: - - master - - 1.14.x - - 1.15.x - pull_request: - branches: [ '*' ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: before cache - continue-on-error: true - run: | - rm -fv ~/.ivy2/.sbt.ivy.lock - find ~/.ivy2/cache -name 'ivydata-*.properties' -print -delete - find ~/.sbt -name '*.lock' -print -delete - - uses: actions/cache@v2 - with: - path: | - ~/.ivy2/cache - ~/.coursier/cache/v1 - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt- - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build the benchmark - run: sbt "+bench/jmh:run -p genSize=0 -p seedCount=0 -bs 1 -wi 0 -i 1 -f 0 -t 1 -r 0 org.scalacheck.bench.GenBench" diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 89ba4ddb0..000000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Examples CI - -on: - push: - branches: - - master - - 1.14.x - - 1.15.x - pull_request: - branches: [ '*' ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: before cache - continue-on-error: true - run: | - rm -fv ~/.ivy2/.sbt.ivy.lock - find ~/.ivy2/cache -name 'ivydata-*.properties' -print -delete - find ~/.sbt -name '*.lock' -print -delete - - uses: actions/cache@v2 - with: - path: | - ~/.ivy2/cache - ~/.coursier/cache/v1 - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt- - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build the examples - run: | - cd examples - for d in */ ; do cd "$d" && sbt test:compile && cd ../ ; done diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml deleted file mode 100644 index af7e1b1cd..000000000 --- a/.github/workflows/scala.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Scala CI - -on: - push: - branches: - - master - - 1.14.x - - 1.15.x - pull_request: - branches: [ '*' ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - scala: - - 2.11.12 - - 2.12.10 - - 2.13.3 - - 0.27.0-RC1 - jdk: - - 1.8 - - 11 - platform: - - jvm - - js - scalajs_version: - - 0.6.33 - - 1.3.0 - sbt_parallel: [true] - workers: - - 4 - deploy: [false] - exclude: - - platform: jvm - scalajs_version: 0.6.33 - - platform: js - jdk: 11 - - platform: js - scala: 0.27.0-RC1 - - platform: js - scala: 2.11.12 - scalajs_version: 0.6.33 - - jdk: 11 - scala: 2.11.12 - - jdk: 11 - scala: 0.27.0-RC1 - steps: - - uses: actions/checkout@v2 - - name: before cache - continue-on-error: true - run: | - rm -fv ~/.ivy2/.sbt.ivy.lock - find ~/.ivy2/cache -name 'ivydata-*.properties' -print -delete - find ~/.sbt -name '*.lock' -print -delete - - uses: actions/cache@v2 - with: - path: | - ~/.ivy2/cache - ~/.coursier/cache/v1 - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt- - - name: Set up JDK ${{ matrix.jdk }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.jdk }} - - name: Build with sbt - run: | - ./tools/travis-script.sh - ./tools/travis-deploy.sh - env: - TRAVIS_BRANCH: ${env:GITHUB_REF} - TRAVIS_COMMIT: ${env:GITHUB_SHA} - TRAVIS_JDK_VERSION: ${{ matrix.java }} - TRAVIS_SCALA_VERSION: ${{ matrix.scala }} - PLATFORM: ${{ matrix.platform }} - SCALAJS_VERSION: ${{ matrix.scalajs_version }} - SBT_PARALLEL: ${{ matrix.sbt_parallel }} - WORKERS: ${{ matrix.workers }} - DEPLOY: ${{ matrix.deploy }} diff --git a/.github/workflows/scalanative.yml b/.github/workflows/scalanative.yml deleted file mode 100644 index 0ddad44ec..000000000 --- a/.github/workflows/scalanative.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Scala native CI - -on: - push: - branches: - - master - - 1.14.x - - 1.15.x - pull_request: - branches: [ '*' ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - scala: - - 2.11.12 - jdk: - - 1.8 - platform: - - native - scalanative_version: - - 0.3.9 - - 0.4.0-M2 - sbt_parallel: [true] - workers: - - 1 - deploy: [false] - steps: - - uses: actions/checkout@v2 - - name: before cache - continue-on-error: true - run: | - rm -fv ~/.ivy2/.sbt.ivy.lock - find ~/.ivy2/cache -name 'ivydata-*.properties' -print -delete - find ~/.sbt -name '*.lock' -print -delete - - uses: actions/cache@v2 - with: - path: | - ~/.ivy2/cache - ~/.coursier/cache/v1 - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt- - - name: Set up JDK ${{ matrix.jdk }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.jdk }} - - name: Install native dependencies - run: sudo apt install clang libunwind-dev libgc-dev libre2-dev - - name: Build with sbt - run: | - ./tools/travis-script.sh - ./tools/travis-deploy.sh - env: - TRAVIS_BRANCH: ${env:GITHUB_REF} - TRAVIS_COMMIT: ${env:GITHUB_SHA} - TRAVIS_JDK_VERSION: ${{ matrix.java }} - TRAVIS_SCALA_VERSION: ${{ matrix.scala }} - PLATFORM: ${{ matrix.platform }} - SCALANATIVE_VERSION: ${{ matrix.scalanative_version }} - SBT_PARALLEL: ${{ matrix.sbt_parallel }} - WORKERS: ${{ matrix.workers }} - DEPLOY: ${{ matrix.deploy }}