Skip to content

Commit

Permalink
Merge pull request #98 from mdedetrich/add-jdks-and-oses-to-ci-matrix
Browse files Browse the repository at this point in the history
Add JDK's and OS'es to GitHub actions CI matrix
  • Loading branch information
mdedetrich authored Nov 2, 2023
2 parents d7ddbbd + 1a3c9a1 commit f05c83d
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 9 deletions.
64 changes: 61 additions & 3 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]
os: [ubuntu-latest, macos-latest, windows-latest]
scala: [2.12.18]
java: [temurin@8]
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

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
Expand All @@ -40,12 +52,31 @@ jobs:
java-version: 8
cache: sbt

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: sbt

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
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 @@ -65,6 +96,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 All @@ -78,6 +120,22 @@ jobs:
java-version: 8
cache: sbt

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: sbt

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: sbt

- name: Download target directories (2.12.18)
uses: actions/download-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sbt-osgi is a plugin for sbt. In order to install sbt, please refer to the sbt d
- sbt-osgi 0.5 → sbt 0.12
- sbt-osgi 0.7 → sbt 0.13
- sbt-osgi 0.9.{0-3} → sbt 0.13 / sbt 1.x
- sbt-osgi 0.9.{4-5} -> sbt 1.x
- sbt-osgi 0.9.{4-x} -> sbt 1.6.2+ (older versions of sbt may work but 1.6.2+ supports all JDK LTS versions)

As sbt-osgi is a plugin for sbt, it is installed like any other sbt plugin, that is by mere configuration: just add sbt-osgi to your global or local plugin definition. Global plugins are defined in `~/.sbt/<SBT_VERSION>/plugins/plugins.sbt` and local plugins are defined in `project/plugins.sbt` in your project.

Expand Down
13 changes: 8 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ ThisBuild / githubWorkflowPublish := Seq(
)
)

ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "macos-latest", "windows-latest")

ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("8"),
JavaSpec.temurin("11"),
JavaSpec.temurin("17")
)

name := "sbt-osgi"
enablePlugins(SbtPlugin)
libraryDependencies ++= Dependencies.sbtOsgi
Expand All @@ -49,11 +57,6 @@ scalacOptions ++= Seq(
"-Xlint",
"-encoding", "UTF-8"
)
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.2.8"
}
}
scriptedLaunchOpts += "-Xmx1024m"
scriptedLaunchOpts ++= Seq("-Dplugin.version=" + version.value)
scriptedLaunchOpts += "-debug"
Expand Down

0 comments on commit f05c83d

Please sign in to comment.