From 3c1fca5ecc8b9a775b5c007789519afafe1b7e21 Mon Sep 17 00:00:00 2001 From: Olafur Pall Geirsson Date: Tue, 21 Apr 2020 08:52:42 +0000 Subject: [PATCH 1/3] Bump version --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 0217c94a..7882b7d0 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -2,7 +2,7 @@ import sbt._ object Dependencies { val x = List(1) // scalafix:ok - def scalafixVersion: String = "0.9.14" + def scalafixVersion: String = "0.9.15" val all = List( "org.eclipse.jgit" % "org.eclipse.jgit" % "5.5.1.201910021850-r", "ch.epfl.scala" % "scalafix-interfaces" % scalafixVersion, From 5ca673e3ca4d822d04b3a90bfb0f1cf0eacfe741 Mon Sep 17 00:00:00 2001 From: Olafur Pall Geirsson Date: Tue, 21 Apr 2020 09:15:51 +0000 Subject: [PATCH 2/3] Setup GitHub Actions --- .gitattributes | 2 ++ .github/workflows/ci.yml | 35 +++++++++++++++++++ .travis.yml | 30 ---------------- appveyor.yml | 28 --------------- project/Dependencies.scala | 2 +- .../internal/sbt/ScalafixAPISuite.scala | 2 ++ 6 files changed, 40 insertions(+), 59 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..80f45d31 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* eol=lf +*.png eol=autocrlf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..1c20e695 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI +on: + push: + branches: + - master + pull_request: +jobs: + test: + name: ${{ matrix.command }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + command: + - "++2.12.11 test scripted" + - "++2.10.7 test 'scripted sbt-scalafix/*'" + steps: + - uses: actions/checkout@v2 + - uses: olafurpg/setup-scala@v7 + - run: sbt ${{ matrix.command }} + windows: + name: Windows tests + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: olafurpg/setup-scala@v7 + - run: sbt ci-windows + shell: bash + checks: + name: Scalafmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: olafurpg/setup-scala@v7 + - run: ./bin/scalafmt --test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0bd5d112..00000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: scala -jdk: -- openjdk8 - -jobs: - include: - - env: TEST="scalafmt" - script: ./bin/scalafmt --test - - env: TEST="sbt 1.2" - script: sbt ++2.12.8 test scripted - - env: TEST="sbt 0.13" - script: sbt ++2.10.7 test "scripted sbt-scalafix/*" - -cache: - directories: - - $HOME/.sbt/1.0/dependency - - $HOME/.sbt/boot/scala* - - $HOME/.sbt/launchers - - $HOME/.ivy2/cache - - $HOME/.coursier - -before_cache: - - du -h -d 1 $HOME/.ivy2/cache - - du -h -d 2 $HOME/.sbt/ - - find $HOME/.sbt -name "*.lock" -type f -delete - - find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete - - rm -rf $HOME/.ivy2/local - -before_install: - - git fetch --tags diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7749b90f..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: '{build}' -os: Windows Server 2012 - -install: - - cmd: SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0 - - cmd: SET PATH=%JAVA_HOME%\bin;%PATH% - - cmd: choco install sbt -ia "INSTALLDIR=""C:\sbt""" - - cmd: SET PATH=C:\sbt\bin;%JAVA_HOME%\bin;%PATH% - # disable dynVer - - ps: Remove-Item Env:\CI - - cmd: sbt version & exit 0 - -environment: - APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=9" - APPVEYOR_SAVE_CACHE_ON_ERROR: true - JAVA_OPTS: -Xss2m -Xmx1024m -XX:-TieredCompilation -XX:ReservedCodeCacheSize=48m -Dfile.encoding=UTF-8 -Djna.nosys=true - -build_script: - - sbt compile - -test_script: - - sbt ci-windows - -cache: - - '%USERPROFILE%\.ivy2\cache' - - '%USERPROFILE%\.sbt' - - '%LOCALAPPDATA%\Coursier\cache' - - '%USERPROFILE%\scoop\cache' diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 7882b7d0..3916545c 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -10,6 +10,6 @@ object Dependencies { // sbt-scalafix doesn't conflict with the user's installed version of sbt-coursier. // Details: https://github.com/olafurpg/coursier-small "com.geirsson" %% "coursier-small" % "1.3.3", - "io.get-coursier" % "interface" % "0.0.19" + "io.get-coursier" % "interface" % "0.0.21" ) } diff --git a/src/test/scala/scalafix/internal/sbt/ScalafixAPISuite.scala b/src/test/scala/scalafix/internal/sbt/ScalafixAPISuite.scala index 796609e9..f59b359f 100644 --- a/src/test/scala/scalafix/internal/sbt/ScalafixAPISuite.scala +++ b/src/test/scala/scalafix/internal/sbt/ScalafixAPISuite.scala @@ -10,6 +10,7 @@ import scalafix.interfaces.ScalafixError import scala.collection.JavaConverters._ import org.scalatest.funsuite.AnyFunSuite +import scala.util.Properties class ScalafixAPISuite extends AnyFunSuite { @@ -23,6 +24,7 @@ class ScalafixAPISuite extends AnyFunSuite { } test("ScalafixPlugin.cli") { + assume(!Properties.isWin) val baos = new ByteArrayOutputStream() val logger = Compat.ConsoleLogger(new PrintStream(baos)) val ScalafixInterface(_, args) = ScalafixInterface.fromToolClasspath( From 4e47fdf5882ed4dc30a9aba691817dfcf89a36de Mon Sep 17 00:00:00 2001 From: Olafur Pall Geirsson Date: Tue, 21 Apr 2020 10:16:32 +0000 Subject: [PATCH 3/3] Disable parallel testing --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index d851a873..79884f66 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,6 @@ inThisBuild( List( + parallelExecution in Test := false, scalafixDependencies := List( // Custom rule published to Maven Central https://github.com/olafurpg/example-scalafix-rule "com.geirsson" %% "example-scalafix-rule" % "1.3.0"