From 921955ec7f73acccd4fd93253885ce30ff9164f8 Mon Sep 17 00:00:00 2001 From: Matthew de Detrich Date: Thu, 14 Sep 2023 08:45:12 +0200 Subject: [PATCH] Update sbt and add windows back to CI --- .github/workflows/ci.yml | 30 +++++++++++++++++-- build.sbt | 7 +++-- project/build.properties | 2 +- project/project/build.properties | 1 + .../.github/workflows/ci.yml | 10 +++---- 5 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 project/project/build.properties diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55191da..c19814b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,11 +22,23 @@ jobs: name: Build and Test strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] scala: [2.12.18] java: [temurin@8, graal_22.3.0@17] runs-on: ${{ matrix.os }} steps: + - name: Ignore line ending differences in git + if: contains(runner.os, 'windows') + shell: bash + run: git config --global core.autocrlf false + + - name: Configure pagefile for Windows + if: contains(runner.os, 'windows') + uses: al-cheb/configure-pagefile-action@v1.3 + with: + minimum-size: 2GB + maximum-size: 8GB + - name: Checkout current branch (full) uses: actions/checkout@v4 with: @@ -51,11 +63,14 @@ jobs: cache: sbt - name: Check that workflows are up to date + shell: bash run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck - - run: sbt '++ ${{ matrix.scala }}' test scripted + - shell: bash + run: sbt '++ ${{ matrix.scala }}' test scripted - name: Compress target directories + shell: bash run: tar cf targets.tar target project/target - name: Upload target directories @@ -75,6 +90,17 @@ jobs: java: [temurin@8] runs-on: ${{ matrix.os }} steps: + - name: Ignore line ending differences in git + if: contains(runner.os, 'windows') + run: git config --global core.autocrlf false + + - name: Configure pagefile for Windows + if: contains(runner.os, 'windows') + uses: al-cheb/configure-pagefile-action@v1.3 + with: + minimum-size: 2GB + maximum-size: 8GB + - name: Checkout current branch (full) uses: actions/checkout@v4 with: diff --git a/build.sbt b/build.sbt index a1d03df..dd89dc3 100644 --- a/build.sbt +++ b/build.sbt @@ -21,8 +21,7 @@ ThisBuild / organization := "com.github.sbt" ThisBuild / crossScalaVersions := Seq(scala212) ThisBuild / scalaVersion := scala212 -// Add windows-latest when https://github.com/sbt/sbt/issues/7082 is resolved -ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "macos-latest") +ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "macos-latest", "windows-latest") ThisBuild / githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test", "scripted"))) ThisBuild / githubWorkflowJavaVersions += JavaSpec.graalvm("22.3.0", "17") @@ -64,6 +63,10 @@ enablePlugins(SbtPlugin) scriptedLaunchOpts ++= Seq("-Dplugin.version=" + version.value) scriptedBufferLog := true +// This sbt version is necessary for CI to work on windows with +// scripted tests, see // https://github.com/sbt/sbt/pull/7087 + +scriptedSbt := "1.9.6" ThisBuild / homepage := Some(url("https://github.com/sbt/sbt-github-actions")) ThisBuild / startYear := Some(2020) diff --git a/project/build.properties b/project/build.properties index 52413ab..2743082 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.3 +sbt.version=1.9.6 diff --git a/project/project/build.properties b/project/project/build.properties new file mode 100644 index 0000000..2743082 --- /dev/null +++ b/project/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.9.6 diff --git a/src/sbt-test/sbtghactions/sbt-native-thin-client/.github/workflows/ci.yml b/src/sbt-test/sbtghactions/sbt-native-thin-client/.github/workflows/ci.yml index f8aca7f..edf23b2 100644 --- a/src/sbt-test/sbtghactions/sbt-native-thin-client/.github/workflows/ci.yml +++ b/src/sbt-test/sbtghactions/sbt-native-thin-client/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.12.14] + scala: [2.12.18] java: [temurin@8] runs-on: ${{ matrix.os }} steps: @@ -77,7 +77,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.12.14] + scala: [2.12.18] java: [temurin@8] runs-on: ${{ matrix.os }} steps: @@ -94,12 +94,12 @@ jobs: java-version: 8 cache: sbt - - name: Download target directories (2.12.14) + - name: Download target directories (2.12.18) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }} + name: target-${{ matrix.os }}-2.12.18-${{ matrix.java }} - - name: Inflate target directories (2.12.14) + - name: Inflate target directories (2.12.18) run: | tar xf targets.tar rm targets.tar