Skip to content

Commit

Permalink
Merge pull request #53 from zio/update-versions
Browse files Browse the repository at this point in the history
update workflow
  • Loading branch information
senia-psm authored Jan 23, 2024
2 parents c4d00c5 + e5c48cb commit 196cc33
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 33 deletions.
54 changes: 26 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
name: CI
env:
JDK_JAVA_OPTIONS: -XX:+PrintCommandLineFlags
JVM_OPTS: -XX:+PrintCommandLineFlags
'on':
workflow_dispatch: {}
release:
Expand All @@ -14,24 +13,23 @@ env:
branches:
- main
pull_request: {}
create: {}
jobs:
build:
name: Build
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Git Checkout
uses: actions/checkout@v3.5.0
uses: actions/checkout@v4.1.0
with:
fetch-depth: '0'
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Setup Scala
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.13.0
with:
distribution: temurin
java-version: '8'
distribution: corretto
java-version: '17'
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6
Expand All @@ -47,16 +45,16 @@ jobs:
continue-on-error: false
steps:
- name: Git Checkout
uses: actions/checkout@v3.5.0
uses: actions/checkout@v4.1.0
with:
fetch-depth: '0'
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Setup Scala
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.13.0
with:
distribution: temurin
java-version: '8'
distribution: corretto
java-version: '17'
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6
Expand All @@ -72,22 +70,22 @@ jobs:
fail-fast: false
matrix:
java:
- '8'
- '11'
- '17'
- '21'
steps:
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Setup Scala
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.13.0
with:
distribution: temurin
distribution: corretto
java-version: ${{ matrix.java }}
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6
- name: Git Checkout
uses: actions/checkout@v3.5.0
uses: actions/checkout@v4.1.0
with:
fetch-depth: '0'
- name: Test
Expand All @@ -99,16 +97,16 @@ jobs:
if: ${{ github.event_name == 'push' }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.5.0
uses: actions/checkout@v4.1.0
with:
fetch-depth: '0'
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Setup Scala
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.13.0
with:
distribution: temurin
java-version: '8'
distribution: corretto
java-version: '17'
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6
Expand All @@ -128,7 +126,7 @@ jobs:
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Create Pull Request
id: cpr
uses: peter-evans/[email protected].0
uses: peter-evans/[email protected].2
with:
body: |-
Autogenerated changes after running the `sbt docs/generateReadme` command of the [zio-sbt-website](https://zio.dev/zio-sbt) plugin.
Expand Down Expand Up @@ -173,16 +171,16 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.5.0
uses: actions/checkout@v4.1.0
with:
fetch-depth: '0'
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Setup Scala
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.13.0
with:
distribution: temurin
java-version: '8'
distribution: corretto
java-version: '17'
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6
Expand All @@ -202,16 +200,16 @@ jobs:
if: ${{ ((github.event_name == 'release') && (github.event.action == 'published')) || (github.event_name == 'workflow_dispatch') }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.5.0
uses: actions/checkout@v4.1.0
with:
fetch-depth: '0'
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Setup Scala
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.13.0
with:
distribution: temurin
java-version: '8'
distribution: corretto
java-version: '17'
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6
Expand All @@ -233,7 +231,7 @@ jobs:
if: ${{ (github.event_name == 'release') && (github.event.action == 'published') }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.5.0
uses: actions/checkout@v4.1.0
with:
fetch-depth: '0'
- name: notify the main repo about the new release of docs package
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.8.2
sbt.version = 1.9.8
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package zio.bson.magnolia

import zio.bson.BsonCodec

// scalafix:off
import scala.language.experimental.macros
// scalafix:on

object DeriveBsonCodec {
def derive[T]: BsonCodec[T] = macro genBoth[T]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import zio.bson.{BsonDecoder, _}

import scala.collection.immutable.{ArraySeq, HashMap}
import scala.jdk.CollectionConverters._

// scalafix:off
import scala.language.experimental.macros
// scalafix:on

trait DeriveBsonDecoder {
type Typeclass[T] = BsonDecoder[T]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import zio.bson.magnolia.BsonCodecConfiguration.SumTypeHandling
import zio.bson.{BsonEncoder, _}

import scala.jdk.CollectionConverters._

// scalafix:off
import scala.language.experimental.macros
// scalafix:on

trait DeriveBsonEncoder {
type Typeclass[T] = BsonEncoder[T]
Expand Down
7 changes: 3 additions & 4 deletions zio-bson/src/main/scala/zio/bson/BsonEncoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ import java.time.{
ZonedDateTime
}
import java.util.UUID
import scala.annotation.unused
import scala.collection.compat._
import scala.jdk.CollectionConverters._

trait BsonEncoder[A] { self =>

{
locally {
// TODO: better way to fix unused import warning.
val _ = IterableOnce
}
Expand All @@ -49,10 +50,8 @@ trait BsonEncoder[A] { self =>
/**
* @return true if encoder can skip this value.
*/
def isAbsent(value: A): Boolean = {
val _ = value
def isAbsent(@unused value: A): Boolean =
false
}

def encode(writer: BsonWriter, value: A, ctx: EncoderContext): Unit

Expand Down

0 comments on commit 196cc33

Please sign in to comment.