Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
branches: master
env:
BUILDKITE_CLEAN_CHECKOUT: true
TRAVIS_SCALA_VERSION: "2.13.3"
TRAVIS_SCALA_VERSION: "2.13.16"
TRAVIS_JOB_NUMBER: "1.1"
agents:
os: linux
Expand All @@ -17,7 +17,7 @@ steps:
branches: master
env:
BUILDKITE_CLEAN_CHECKOUT: true
TRAVIS_SCALA_VERSION: "2.12.12"
TRAVIS_SCALA_VERSION: "2.12.20"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is still alive, it needs a 3.3.6 section. Or maybe it works with the new 2.13.x and 3.x syntax.

TRAVIS_JOB_NUMBER: "1.2"
agents:
os: linux
Expand Down
162 changes: 162 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# 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: ['**', '!update/**', '!pr/**']
push:
branches: ['**', '!update/**', '!pr/**']
tags: [v*]

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


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

jobs:
build:
name: Test
strategy:
matrix:
os: [ubuntu-22.04]
scala: [2.12, 2.13, 3]
java: [temurin@8]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

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

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

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
run: sbt +update

- name: Check that workflows are up to date
run: sbt githubWorkflowCheck

- name: Check headers and formatting
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04'
run: sbt '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck

- name: Test
run: sbt '++ ${{ matrix.scala }}' test

- name: Check binary compatibility
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04'
run: sbt '++ ${{ matrix.scala }}' mimaReportBinaryIssues

- name: Generate API documentation
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04'
run: sbt '++ ${{ matrix.scala }}' doc

dependency-submission:
name: Submit Dependencies
if: github.event.repository.fork == false && github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-22.04]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

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

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

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
run: sbt +update

- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
with:
modules-ignore: docs_2.12 docs_2.13 docs_3
configs-ignore: test scala-tool scala-doc-tool test-internal

site:
name: Generate Site
strategy:
matrix:
os: [ubuntu-22.04]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

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

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

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
run: sbt +update

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

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt +update

- name: Generate site
run: sbt docs/tlSite

- name: Publish site
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/target/docs/site
keep_files: true
59 changes: 59 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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
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=/tmp/tmp.$$

# 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
81 changes: 26 additions & 55 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
import laika.ast.Path.Root
import laika.helium.Helium
import laika.helium.config._
import java.net.URL

ThisBuild / organization := "io.getnelson.quiver"
ThisBuild / organizationName := "Nelson Team"
ThisBuild / scalaVersion := Scala212Version
ThisBuild / crossScalaVersions := Seq(
Scala212Version,
Scala213Version,
Scala3Version
)
ThisBuild / tlBaseVersion := "8.0"
// Pending a bot account or API key to add to GitHub
ThisBuild / githubWorkflowPublishTargetBranches := Nil

lazy val quiver = project
.in(file("."))
.aggregate(core.jvm, core.js, codecs.jvm, codecs.js, docs)
.settings(
skip in publish := true
publish / skip := true
)

val CatsVersion = "2.6.1"
val ScalacheckShapeless = "1.2.5"
val CollectionsCompat = "2.5.0"
val CollectionsCompat = "2.13.0"
val ScodecVersion = "1.11.7"
val Scodec2Version = "2.0.0"
val Scala212Version = "2.12.14"
val Scala213Version = "2.13.6"
val Scala3Version = "3.0.1"
val Scala212Version = "2.12.20"
val Scala213Version = "2.13.16"
val Scala3Version = "3.3.6"

lazy val core = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
Expand All @@ -26,26 +41,11 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
"org.typelevel" %%% "cats-laws" % CatsVersion % Test
)
)
.settings(commonSettings)
.settings(silenceUnusedImport)
.settings(coverageEnabled := scalaBinaryVersion.value == "2.13")
.jsSettings(coverageEnabled := false)
.settings(coverageEnabled := false)

val silenceUnusedImport = Seq(
scalacOptions ++= {
if (scalaBinaryVersion.value.startsWith("2."))
Seq(
"-Wconf:cat=unused-imports&site=quiver:s,any:wv",
"-Wconf:cat=unused-imports:s,any:wv"
)
else Seq.empty
}
)

val commonSettings = Seq(
organization := "io.getnelson.quiver",
scalaVersion := Scala212Version,
crossScalaVersions := Seq(Scala212Version, Scala213Version, Scala3Version)
Compile / scalacOptions += "-Wconf:origin=scala.collection.compat._:s"
)

lazy val codecs = crossProject(JSPlatform, JVMPlatform)
Expand All @@ -68,38 +68,9 @@ lazy val codecs = crossProject(JSPlatform, JVMPlatform)
else Seq.empty
}
)
.settings(commonSettings)
.settings(coverageEnabled := scalaBinaryVersion.value == "2.13")
.jsSettings(coverageEnabled := false)
.settings(coverageEnabled := false)

lazy val docsMappingsAPIDir = settingKey[String](
"Name of subdirectory in site target directory for api docs"
)
lazy val docs = project
.in(file("quiver-docs"))
.dependsOn(core.jvm, codecs.jvm)
.enablePlugins(MdocPlugin, MicrositesPlugin, ScalaUnidocPlugin)
.settings(commonSettings)
.settings(
crossScalaVersions -= Scala3Version,
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(
core.jvm,
codecs.jvm
),
docsMappingsAPIDir := "api",
addMappingsToSiteDir(
mappings in (ScalaUnidoc, packageDoc),
docsMappingsAPIDir
),
mdocVariables := {
val stableVersion: String =
version.value.replaceFirst("[\\+\\-].*", "")
Map("VERSION" -> stableVersion)
},
mdocIn := (baseDirectory in ThisBuild).value / "docs" / "mdoc",
micrositeName := "Quiver - a Scala graph library",
micrositeUrl := "https://getnelson.github.io",
micrositeDocumentationUrl := "/quiver/api/index.html",
micrositeDocumentationLabelDescription := "API Documentation",
micrositeBaseUrl := "/quiver"
)
.in(file("site"))
.enablePlugins(TypelevelSitePlugin)
.dependsOn(core.jvm)
16 changes: 16 additions & 0 deletions codecs/src/main/scala-2/ScodecPlatform.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2013 Nelson Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

//: ----------------------------------------------------------------------------
//: Copyright (C) 2015 Verizon. All Rights Reserved.
//:
Expand Down
Loading