Skip to content

Commit

Permalink
Merge pull request #12 from harry0000/chore/update-ci
Browse files Browse the repository at this point in the history
Update CI
  • Loading branch information
harry0000 authored Jun 10, 2024
2 parents 10d04c6 + f400e52 commit 0c29a95
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 25 deletions.
57 changes: 34 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@
name: CI

on:
pull_request:
branches:
- '**'
push:
branches:
- main

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
env:
# define Java options for both official sbt and sbt-extras
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: sbt
- name: 'Run Scalafmt'
run: sbt -v ++3.4.2 scalafmtSbt scalafmtAll
test:
strategy:
fail-fast: false
matrix:
name: [ "test" ]
scala: [ 3.3.0, 3.4.1 ]
scala: [ 3.3.0, 3.4.2 ]
java: [ 20, 21 ]
include:
- name: "format"
scala: 3.4.1
java: 21
exclude:
- name: "test"
scala: 3.3.0
- scala: 3.3.0
java: 21
runs-on: ubuntu-latest
env:
# define Java options for both official sbt and sbt-extras
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: sbt
- shell: bash
run: |
case ${{ matrix.name }} in
"format")
sbt -v ++${{ matrix.scala }} scalafmtSbt scalafmtAll
git diff --exit-code
;;
"test")
sbt -v ++${{ matrix.scala }} test
;;
*)
echo "unknown job"
exit 1
esac
- name: 'Run tests'
run: sbt -v ++${{ matrix.scala }} test
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lazy val supportedScalaVersions = List("3.4.1", "3.3.0")
lazy val supportedScalaVersions = List("3.4.2", "3.3.0")

lazy val root = project
.in(file("."))
Expand All @@ -16,6 +16,6 @@ lazy val root = project
"-unchecked",
"-Wunused:all"
),
libraryDependencies += "org.scalameta" %% "munit" % "1.0.0-M11" % Test,
libraryDependencies += "org.scalameta" %% "munit" % "1.0.0" % Test,
Test / parallelExecution := false
)

0 comments on commit 0c29a95

Please sign in to comment.