Skip to content

Commit

Permalink
Maintenance
Browse files Browse the repository at this point in the history
- Update to Scala 2.13.14
- Update base images for Cassandra
  • Loading branch information
calvinlfer committed Aug 17, 2024
1 parent f97ba57 commit 27e1f8f
Show file tree
Hide file tree
Showing 6 changed files with 229 additions and 9 deletions.
7 changes: 4 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
inThisBuild {
val scala212 = "2.12.19"
val scala213 = "2.13.13"
val scala213 = "2.13.14"
val scala3 = "3.3.3"

List(
Expand Down Expand Up @@ -47,6 +47,7 @@ inThisBuild {
new TestFramework("weaver.framework.CatsEffect")
),
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
versionScheme := Some("early-semver"),
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeProfileName := "io.kaizen-solutions",
Expand Down Expand Up @@ -77,7 +78,7 @@ lazy val core =
val datastaxV = "4.17.0"

val zio = "dev.zio"
val zioV = "2.1.6"
val zioV = "2.1.7"
val magnoliaForScala2 = "com.softwaremill.magnolia1_2" %% "magnolia" % "1.1.10"
val scalaReflectForScala2 = "org.scala-lang" % "scala-reflect" % scalaVersion.value
val magnoliaForScala3 = "com.softwaremill.magnolia1_3" %% "magnolia" % "1.3.7"
Expand All @@ -90,7 +91,7 @@ lazy val core =
zio %% "zio-test-scalacheck" % zioV % Test,
zio %% "zio-test-sbt" % zioV % Test,
"com.dimafeng" %% "testcontainers-scala" % "0.41.4" % Test,
"com.outr" %% "scribe-slf4j" % "3.14.0" % Test
"com.outr" %% "scribe-slf4j" % "3.15.0" % Test
)

val isScala2x = scalaVersion.value.startsWith("2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ trait CassandraContainer {
object CassandraContainer {
def apply(cassType: CassandraType): Resource[IO, CassandraContainer] = {
val nativePort = 9042
val datastaxEnterprise = "datastax/dse-server:6.8.19"
val datastaxEnterprise = "datastax/dse-server:6.9.1"
val datastaxEnv = Map(
"DS_LICENSE" -> "accept",
"JVM_EXTRA_OPTS" -> "-Dcassandra.skip_wait_for_gossip_to_settle=0 -Dcassandra.load_ring_state=false -Dcassandra.initial_token=1 -Dcassandra.num_tokens=nil -Dcassandra.allocate_tokens_for_local_replication_factor=nil"
)
val vanilla = "cassandra:4"
val vanilla = "cassandra:5"
val vanillaEnv = Map(
"CASSANDRA_ENDPOINT_SNITCH" -> "GossipingPropertyFileSnitch",
"CASSANDRA_DC" -> "dc1",
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.24.0")
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.12")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.0")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.13")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
Expand Down
159 changes: 159 additions & 0 deletions zio/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# This file was automatically generated by sbt-github-actions using the
# githubWorkflowGenerate task. You should add and commit this file to
# your git repository. It goes without saying that you shouldn't edit
# this file by hand! Instead, if you wish to make changes, you should
# change your sbt build configuration to revise the workflow description
# to meet your needs, then regenerate this file.

name: Continuous Integration

on:
pull_request:
branches: ['**']
push:
branches: ['**']
tags: [v*]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.19, 2.13.14, 3.3.3]
java: [temurin@11, temurin@17, temurin@21]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

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

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

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

- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Check that workflows are up to date
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck

- name: Build & Test
run: sbt '++ ${{ matrix.scala }}' clean coverage test

- name: Coverage
run: sbt '++ ${{ matrix.scala }}' coverageAggregate

- name: Compress target directories
run: tar cf targets.tar target core/target zio/target cats-effect/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
path: targets.tar

publish:
name: Publish Artifacts
needs: [build]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

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

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

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

- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Download target directories (2.12.19)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-2.12.19-${{ matrix.java }}

- name: Inflate target directories (2.12.19)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.14)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-2.13.14-${{ matrix.java }}

- name: Inflate target directories (2.13.14)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.3.3)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-3.3.3-${{ matrix.java }}

- name: Inflate target directories (3.3.3)
run: |
tar xf targets.tar
rm targets.tar
- name: Publish project
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: sbt ci-release
60 changes: 60 additions & 0 deletions zio/.github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This file was automatically generated by sbt-github-actions using the
# githubWorkflowGenerate task. You should add and commit this file to
# your git repository. It goes without saying that you shouldn't edit
# this file by hand! Instead, if you wish to make changes, you should
# change your sbt build configuration to revise the workflow description
# to meet your needs, then regenerate this file.

name: Clean

on: push

jobs:
delete-artifacts:
name: Delete Artifacts
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Delete artifacts
shell: bash {0}
run: |
# Customize those three lines with your repository and credentials:
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
# A shortcut to call GitHub API.
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }
# A temporary file which receives HTTP response headers.
TMPFILE=$(mktemp)
# An associative array, key: artifact name, value: number of artifacts of that name.
declare -A ARTCOUNT
# Process all artifacts on this repository, loop on returned "pages".
URL=$REPO/actions/artifacts
while [[ -n "$URL" ]]; do
# Get current page, get response headers in a temporary file.
JSON=$(ghapi --dump-header $TMPFILE "$URL")
# Get URL of next page. Will be empty if we are at the last page.
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//')
rm -f $TMPFILE
# Number of artifacts on this page:
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') ))
# Loop on all artifacts on this page.
for ((i=0; $i < $COUNT; i++)); do
# Get name of artifact and count instances of this name.
name=$(jq <<<$JSON -r ".artifacts[$i].name?")
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1))
id=$(jq <<<$JSON -r ".artifacts[$i].id?")
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") ))
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
ghapi -X DELETE $REPO/actions/artifacts/$id
done
done
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ trait CassandraContainer {
object CassandraContainer {
def apply(cassType: CassandraType): URIO[Scope, CassandraContainer] = {
val nativePort = 9042
val datastaxEnterprise = "datastax/dse-server:6.8.19"
val datastaxEnterprise = "datastax/dse-server:6.9.1"
val datastaxEnv = Map(
"DS_LICENSE" -> "accept",
"JVM_EXTRA_OPTS" -> "-Dcassandra.skip_wait_for_gossip_to_settle=0 -Dcassandra.load_ring_state=false -Dcassandra.initial_token=1 -Dcassandra.num_tokens=nil -Dcassandra.allocate_tokens_for_local_replication_factor=nil"
)
val vanilla = "cassandra:4"
val vanilla = "cassandra:5"
val vanillaEnv = Map(
"CASSANDRA_ENDPOINT_SNITCH" -> "GossipingPropertyFileSnitch",
"CASSANDRA_DC" -> "dc1",
Expand Down

0 comments on commit 27e1f8f

Please sign in to comment.