From e4676642e88a8153cf77a8d11e10fe0a549a948f Mon Sep 17 00:00:00 2001 From: TATSUNO Yasuhiro Date: Tue, 24 Nov 2020 10:04:03 +0900 Subject: [PATCH 1/3] Migrate to Github actions --- .github/workflows/ci.yaml | 23 +++++++++++++++++++++++ .github/workflows/format.yml | 6 +++--- .mergify.yml | 2 +- .travis.yml | 36 ------------------------------------ build.sbt | 7 ++++--- project/plugins.sbt | 1 - 6 files changed, 31 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..dbd4aae9e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,23 @@ +name: CI +on: [pull_request] +jobs: + ci: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + scala: [2.13.3, 2.12.12] + nodejs: [14.15.1, 12.19.1, 10.23.0] + steps: + - uses: actions/checkout@v2 + - uses: olafurpg/setup-scala@v10 + with: + java-version: adopt@1.11 + - run: export NODEJS_VERSION=${{ matrix.nodejs }} + - uses: coursier/cache-action@v5 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.nodejs }} + - run: npm install + - name: Run Tests + run: sbt ++${{ matrix.scala }} test diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 2bf6fcf73..e86ee4341 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -6,10 +6,10 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@v1 - - uses: olafurpg/setup-scala@v5 + - uses: actions/checkout@v2 + - uses: olafurpg/setup-scala@v10 - name: Check Scalafmt/Scaladoc - run: sbt ++2.13.3 scalafmtSbtCheck scalafmtCheck test:scalafmtCheck nodejs_v14/doc core/doc + run: sbt scalafmtSbtCheck scalafmtCheck test:scalafmtCheck nodejs_v14/doc core/doc - name: Install NPM deps run: npm install - name: Check README diff --git a/.mergify.yml b/.mergify.yml index 11a259cd8..9e342ce37 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -2,7 +2,7 @@ pull_request_rules: - name: Automatic merge on approval conditions: - "author=scala-steward" - - "status-success=Travis CI - Pull Request" + - "status-success=CI" - "status-success=format" actions: merge: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9120fb50c..000000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -dist: xenial -language: scala - -scala: - - 2.12.12 - - 2.13.3 - -jdk: - - openjdk11 - -env: - matrix: - - TRAVIS_NODE_VERSION="14.14.0" - - TRAVIS_NODE_VERSION="12.19.0" - - TRAVIS_NODE_VERSION="10.22.1" - -script: - - sbt ++$TRAVIS_SCALA_VERSION test - -install: - - rm -rf ~/.nvm && - git clone https://github.com/nvm-sh/nvm.git ~/.nvm && - (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && - source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION - -before_cache: - - rm -fv $HOME/.ivy2/.sbt.ivy.lock - - find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete - - find $HOME/.cache/coursier -name "*.lock" -print -delete - - find $HOME/.sbt -name "*.lock" -print -delete - -cache: - directories: - - $HOME/.ivy2 - - $HOME/.cache/coursier - - $HOME/.sbt diff --git a/build.sbt b/build.sbt index 66d7778f7..b528b891e 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,5 @@ organization in ThisBuild := "net.exoego" +crossScalaVersions in ThisBuild := Seq("2.13.3","2.12.12") lazy val root = { val p = (project in file(".")) @@ -9,9 +10,9 @@ lazy val root = { .settings( name := "scala-js-nodejs" ) - val travisNodeVersion = Option(System.getenv("TRAVIS_NODE_VERSION")).filter(_.nonEmpty).getOrElse("") - if (travisNodeVersion.startsWith("10.")) p.aggregate(nodejs_v10) - else if (travisNodeVersion.startsWith("12.")) p.aggregate(nodejs_v10, nodejs_v12) + val nodejsVersion = Option(System.getenv("NODEJS_VERSION")).filter(_.nonEmpty).getOrElse("") + if (nodejsVersion.startsWith("10.")) p.aggregate(nodejs_v10) + else if (nodejsVersion.startsWith("12.")) p.aggregate(nodejs_v10, nodejs_v12) else p.aggregate(nodejs_v10, nodejs_v12, nodejs_v14) } diff --git a/project/plugins.sbt b/project/plugins.sbt index 957713f77..d8e682041 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,4 +4,3 @@ addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.5") addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") -addSbtPlugin("com.dwijnand" % "sbt-travisci" % "1.2.0") From 1f0457dee7fc86e349cd0c6c304b4d2e41bbe3e8 Mon Sep 17 00:00:00 2001 From: TATSUNO Yasuhiro Date: Tue, 24 Nov 2020 11:49:53 +0900 Subject: [PATCH 2/3] Reformat --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index b528b891e..b9ba6e5bd 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,5 @@ organization in ThisBuild := "net.exoego" -crossScalaVersions in ThisBuild := Seq("2.13.3","2.12.12") +crossScalaVersions in ThisBuild := Seq("2.13.3", "2.12.12") lazy val root = { val p = (project in file(".")) From 100da68ce6d4b88720aac6d77173b3c12a765a42 Mon Sep 17 00:00:00 2001 From: TATSUNO Yasuhiro Date: Tue, 24 Nov 2020 11:51:09 +0900 Subject: [PATCH 3/3] Pass env --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dbd4aae9e..aebe5b9a7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,6 @@ jobs: - uses: olafurpg/setup-scala@v10 with: java-version: adopt@1.11 - - run: export NODEJS_VERSION=${{ matrix.nodejs }} - uses: coursier/cache-action@v5 - uses: actions/setup-node@v1 with: @@ -21,3 +20,5 @@ jobs: - run: npm install - name: Run Tests run: sbt ++${{ matrix.scala }} test + env: + NODEJS_VERSION: ${{ matrix.nodejs }}