Adding real merge request builds.
All checks were successful
/ Build and Test Library Snapshot (pull_request) Successful in 1m20s
All checks were successful
/ Build and Test Library Snapshot (pull_request) Successful in 1m20s
- 100% code coverage - Pre-commit enforced at build time - Code coverage enforced at build time - Publish snapshot to maven repo
This commit is contained in:
parent
00872a4da1
commit
2322e9afc8
7 changed files with 70 additions and 15 deletions
|
@ -1,8 +0,0 @@
|
||||||
on: [push]
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: alpine:3.19
|
|
||||||
steps:
|
|
||||||
- run: echo Verifying builds
|
|
24
.forgejo/workflows/pull_request.yaml
Normal file
24
.forgejo/workflows/pull_request.yaml
Normal 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: ${{ secrets.GS_MAVEN_TOKEN }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
name: 'Checkout Repository'
|
||||||
|
- 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
|
|
@ -5,7 +5,13 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
- id: fix-byte-order-marker
|
||||||
|
- id: mixed-line-ending
|
||||||
|
args: ['--fix=lf']
|
||||||
|
description: Enforces using only 'LF' line endings.
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: check-yaml
|
||||||
- repo: https://git.garrity.co/garrity-software/gs-pre-commit-scala
|
- repo: https://git.garrity.co/garrity-software/gs-pre-commit-scala
|
||||||
rev: v0.1.3
|
rev: v1.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: scalafmt
|
- id: scalafmt
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
val scala3: String = "3.3.1"
|
val scala3: String = "3.4.0"
|
||||||
|
|
||||||
ThisBuild / scalaVersion := scala3
|
ThisBuild / scalaVersion := scala3
|
||||||
ThisBuild / versionScheme := Some("semver-spec")
|
ThisBuild / versionScheme := Some("semver-spec")
|
||||||
|
@ -6,7 +6,10 @@ ThisBuild / gsProjectName := "gs-uuid"
|
||||||
|
|
||||||
val sharedSettings = Seq(
|
val sharedSettings = Seq(
|
||||||
scalaVersion := scala3,
|
scalaVersion := scala3,
|
||||||
version := semVerSelected.value
|
version := semVerSelected.value,
|
||||||
|
coverageFailOnMinimum := true,
|
||||||
|
coverageMinimumStmtTotal := 100,
|
||||||
|
coverageMinimumBranchTotal := 100
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val testSettings = Seq(
|
lazy val testSettings = Seq(
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
sbt.version=1.9.8
|
sbt.version=1.9.9
|
||||||
|
|
|
@ -1,10 +1,33 @@
|
||||||
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
|
def selectCredentials(): Credentials =
|
||||||
|
if ((Path.userHome / ".sbt" / ".credentials").exists())
|
||||||
|
Credentials(Path.userHome / ".sbt" / ".credentials")
|
||||||
|
else
|
||||||
|
Credentials.apply(
|
||||||
|
realm = "Reposilite",
|
||||||
|
host = "maven.garrity.co",
|
||||||
|
userName = sys.env
|
||||||
|
.get("GS_MAVEN_USER")
|
||||||
|
.getOrElse(
|
||||||
|
throw new RuntimeException(
|
||||||
|
"You must either provide ~/.sbt/.credentials or specify the GS_MAVEN_USER environment variable."
|
||||||
|
)
|
||||||
|
),
|
||||||
|
passwd = sys.env
|
||||||
|
.get("GS_MAVEN_TOKEN")
|
||||||
|
.getOrElse(
|
||||||
|
throw new RuntimeException(
|
||||||
|
"You must either provide ~/.sbt/.credentials or specify the GS_MAVEN_TOKEN environment variable."
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
credentials += selectCredentials()
|
||||||
|
|
||||||
externalResolvers := Seq(
|
externalResolvers := Seq(
|
||||||
"Garrity Software Mirror" at "https://maven.garrity.co/releases",
|
"Garrity Software Mirror" at "https://maven.garrity.co/releases",
|
||||||
"Garrity Software Releases" at "https://maven.garrity.co/gs"
|
"Garrity Software Releases" at "https://maven.garrity.co/gs"
|
||||||
)
|
)
|
||||||
|
|
||||||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.8")
|
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11")
|
||||||
addSbtPlugin("gs" % "sbt-garrity-software" % "0.2.0")
|
addSbtPlugin("gs" % "sbt-garrity-software" % "0.2.0")
|
||||||
addSbtPlugin("gs" % "sbt-gs-semver" % "0.2.0")
|
addSbtPlugin("gs" % "sbt-gs-semver" % "0.2.0")
|
||||||
|
|
|
@ -50,6 +50,13 @@ class UUIDTests extends munit.FunSuite:
|
||||||
assert(parsed == Some(base))
|
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(
|
private def doGen(
|
||||||
using
|
using
|
||||||
UUID.Generator
|
UUID.Generator
|
||||||
|
|
Loading…
Add table
Reference in a new issue