Skip to content

Commit

Permalink
Merge pull request #163 from mdedetrich/add-windows-back-to-ci
Browse files Browse the repository at this point in the history
Update sbt and add windows back to CI
  • Loading branch information
mdedetrich authored Sep 15, 2023
2 parents e1d9490 + 70aa5c6 commit 04f573a
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_graalvm@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:
Expand All @@ -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
Expand All @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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(Graalvm.Distribution("graalvm"), "17")

Expand Down Expand Up @@ -64,6 +63,9 @@ 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)
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.3
sbt.version=1.9.6
1 change: 1 addition & 0 deletions project/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.9.6
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 04f573a

Please sign in to comment.