Full code coverage and PR builds.
Some checks failed
/ Build and Test Library Snapshot (pull_request) Failing after 2m36s

This commit is contained in:
Pat Garrity 2024-03-17 21:46:46 -05:00
parent 3c6a8a5dfd
commit d676f8a0ae
Signed by: pfm
GPG key ID: 5CA5D21BAB7F3A76
4 changed files with 36 additions and 14 deletions

View file

@ -1,12 +0,0 @@
on: [push]
jobs:
test:
runs-on: docker
container:
image: registry.garrity.co:8443/gs/ci-scala:latest
env:
GS_MAVEN_USER: ${{ vars.GS_MAVEN_USER }}
GS_MAVEN_TOKEN: ${{ vars.GS_MAVEN_TOKEN }}
steps:
- uses: actions/checkout@v4
- run: sbt test

View file

@ -0,0 +1,24 @@
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
library_snapshot:
runs-on: docker
container:
image: registry.garrity.co:8443/gs/ci-scala:latest
name: 'Build and Test Library Snapshot'
env:
GS_MAVEN_USER: ${{ vars.GS_MAVEN_USER }}
GS_MAVEN_TOKEN: ${{ vars.GS_MAVEN_TOKEN }}
steps:
- uses: actions/checkout@v4
name: 'Checkout ${{ env.GITHUB_HEAD_REF }}'
- name: 'Pre-Commit'
run: |
pre-commit install
pre-commit run --all-files
- name: 'Unit Tests and Code Coverage'
run: sbt clean coverage test coverageReport
- name: 'Publish Snapshot'
run: sbt clean publish

View file

@ -5,8 +5,11 @@ ThisBuild / versionScheme := Some("semver-spec")
ThisBuild / gsProjectName := "gs-uuid"
val sharedSettings = Seq(
scalaVersion := scala3,
version := semVerSelected.value
scalaVersion := scala3,
version := semVerSelected.value,
coverageFailOnMinimum := true,
coverageMinimumStmtTotal := 100,
coverageMinimumBranchTotal := 100
)
lazy val testSettings = Seq(

View file

@ -50,6 +50,13 @@ class UUIDTests extends munit.FunSuite:
assert(parsed == Some(base))
}
test("should return lsb, msb, and if the UUID is zero") {
val uuid = UUID.parse("00000000-0000-0000-0000-000000000000")
assert(uuid.map(_.lsb()) == Some(0L))
assert(uuid.map(_.msb()) == Some(0L))
assert(uuid.map(_.isZero()) == Some(true))
}
private def doGen(
using
UUID.Generator