Skip to content

Commit

Permalink
CI: test all platforms, separate into steps
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Feb 19, 2025
1 parent 79339b9 commit 8be1c5e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 36 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '*'
pull_request:
release:
types: [published]
types: [ published ]

permissions:
contents: read
Expand All @@ -17,17 +17,13 @@ jobs:
if: github.event_name != 'release'
strategy:
fail-fast: false
max-parallel: 8
matrix:
java:
- '11'
- '21'
os:
- windows-latest
- ubuntu-latest
platform:
- 'jvm'
- 'native'
scala:
- '2.12.20'
- '2.13.16'
Expand All @@ -43,19 +39,22 @@ jobs:
distribution: 'temurin'
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- run:
# for GitOps tests
- run: # for GitOps tests
git config --global user.email "[email protected]" && git config --global user.name "scalafmt"
- run: sbt ++${{ matrix.scala }} ci-test-${{ matrix.platform }}
shell: bash
- run: sbt ++${{ matrix.scala }} test-jvm
- run: sbt ++${{ matrix.scala }} test-js
- run: sbt ++${{ matrix.scala }} test-native
- run: sbt ++${{ matrix.scala }} publishLocal
- run: sbt ++${{ matrix.scala }} docs/run
if: startsWith(matrix.scala, '2.12.')
community-test:
if: github.event_name != 'release'
strategy:
fail-fast: false
matrix:
java: [ '11' ]
os: [windows-latest, ubuntu-latest]
group: [Scala2, Scala3, Spark, Intellij, Other]
os: [ windows-latest, ubuntu-latest ]
group: [ Scala2, Scala3, Spark, Intellij, Other ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -89,8 +88,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
libc: [default, musl]
os: [ macOS-latest, ubuntu-latest ]
libc: [ default, musl ]
exclude:
- os: macOS-latest
libc: musl
Expand Down Expand Up @@ -144,12 +143,12 @@ jobs:
strategy:
fail-fast: false
matrix:
deploy: [
{ os : macOS-13, name: scalafmt-x86_64-apple-darwin},
{ os : macOS-14, name: scalafmt-aarch64-apple-darwin},
{ os : ubuntu-latest, name: scalafmt-x86_64-pc-linux},
{ os : ubuntu-24.04-arm, name: scalafmt-aarch64-pc-linux},
{ os : windows-latest, name: scalafmt-x86_64-pc-win32}
deploy: [
{ os: macOS-13, name: scalafmt-x86_64-apple-darwin },
{ os: macOS-14, name: scalafmt-aarch64-apple-darwin },
{ os: ubuntu-latest, name: scalafmt-x86_64-pc-linux },
{ os: ubuntu-24.04-arm, name: scalafmt-aarch64-pc-linux },
{ os: windows-latest, name: scalafmt-x86_64-pc-win32 }
]
runs-on: ${{ matrix.deploy.os }}
env:
Expand Down Expand Up @@ -181,7 +180,7 @@ jobs:
asset_name: ${{ matrix.deploy.name }}
asset_content_type: application/zip
dockerize:
needs: [scala-native]
needs: [ scala-native ]
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
Expand Down
19 changes: 3 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,9 @@ addCommandAlias(
"scala-native",
"cliNative/compile;cliNative/nativeLink;copyScalaNative",
)

commands ++= Seq(
Command.command("ci-test-jvm") { s =>
val docsTest = if (isScala212.value) "docs/run" else "version"
// jvm tests
"tests/test" :: "cli/test" ::
// js tests
"testsJS/test" :: "cliJS/test" ::
// other
"publishLocal" :: docsTest :: s
},
Command.command("ci-test-native")(s =>
// for native, we don't publish nor build docs
"testsNative/test" :: "cliNative/test" :: s,
),
)
addCommandAlias("test-jvm", "tests/test;cli/test")
addCommandAlias("test-js", "testsJS/test;cliJS/test")
addCommandAlias("test-native", "testsNative/test;cliNative/test")

lazy val dynamic = crossProject(JVMPlatform) // don't build for NativePlatform
.withoutSuffixFor(JVMPlatform).in(file("scalafmt-dynamic")).settings(
Expand Down

0 comments on commit 8be1c5e

Please sign in to comment.