From 1e582ed191ab14dca97ba40625f74f1b1509bbbd Mon Sep 17 00:00:00 2001 From: Matthew de Detrich Date: Tue, 26 Dec 2023 14:31:09 +1100 Subject: [PATCH] Update sbt-github-actions and add windows support --- .github/workflows/ci.yml | 32 +++++++++++++++++++++++++++++++- build.sbt | 2 ++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e44a440..d426848 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,11 +22,24 @@ jobs: name: Build and Test strategy: matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, windows-latest] scala: [2.12.18, 2.13.12, 3.3.1] java: [temurin@8, temurin@11, temurin@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 + disk-root: 'C:' + - name: Checkout current branch (full) uses: actions/checkout@v4 with: @@ -57,21 +70,26 @@ jobs: cache: sbt - name: Check that workflows are up to date + shell: bash run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck - name: Report binary compatibility issues + shell: bash run: sbt '++ ${{ matrix.scala }}' mimaReportBinaryIssues - name: Build project + shell: bash run: sbt '++ ${{ matrix.scala }}' clean coverage test - name: Upload coverage data to Coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_FLAG_NAME: Scala ${{ matrix.scala }} + shell: bash run: sbt '++ ${{ matrix.scala }}' coverageReport coverageAggregate coveralls - name: Compress target directories + shell: bash run: tar cf targets.tar target support/stream-circe/target http-json/target tests/target stream-json/target support/http-circe/target project/target - name: Upload target directories @@ -91,6 +109,18 @@ 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 + disk-root: 'C:' + - name: Checkout current branch (full) uses: actions/checkout@v4 with: diff --git a/build.sbt b/build.sbt index 6badefa..841f7b0 100644 --- a/build.sbt +++ b/build.sbt @@ -205,3 +205,5 @@ ThisBuild / githubWorkflowJavaVersions := List( JavaSpec.temurin("11"), JavaSpec.temurin("17") ) + +ThisBuild / githubWorkflowOSes += "windows-latest"