Skip to content

Commit

Permalink
Merge branch 'main' into update-dependencies-20240920-b
Browse files Browse the repository at this point in the history
  • Loading branch information
softinio authored Sep 21, 2024
2 parents f923988 + 998af75 commit cb5e388
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 113 deletions.
58 changes: 35 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,72 +29,80 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [3]
java: [corretto@21]
java: [temurin@21]
project: [rootJVM]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Install sbt
if: contains(runner.os, 'macos')
run: brew install sbt

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: sbt update
if: matrix.java == 'corretto@21' && steps.setup-java-corretto-21.outputs.cache-hit == 'false'
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.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 == 'corretto@21' && matrix.os == 'ubuntu-latest'
if: matrix.java == 'temurin@21' && matrix.os == 'ubuntu-latest'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck

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

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

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

dependency-submission:
name: Submit Dependencies
if: github.event_name != 'pull_request'
if: github.event.repository.fork == false && github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-latest]
java: [corretto@21]
java: [temurin@21]
runs-on: ${{ matrix.os }}
steps:
- name: Install sbt
if: contains(runner.os, 'macos')
run: brew install sbt

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

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

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

- name: Submit Dependencies
Expand All @@ -108,33 +116,37 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [corretto@21]
java: [temurin@21]
runs-on: ${{ matrix.os }}
steps:
- name: Install sbt
if: contains(runner.os, 'macos')
run: brew install sbt

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: sbt update
if: matrix.java == 'corretto@21' && steps.setup-java-corretto-21.outputs.cache-hit == 'false'
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.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@v3.9.3
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/target/docs/site
Expand Down
22 changes: 11 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ ThisBuild / githubWorkflowPublishTargetBranches := Seq()
// publish website from this branch
ThisBuild / tlSitePublishBranch := Some("main")

ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.corretto("21"))
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("21"))

val Scala3 = "3.3.3"
val Scala3 = "3.5.1"
ThisBuild / crossScalaVersions := Seq(Scala3)
ThisBuild / scalaVersion := Scala3 // the default Scala

Expand All @@ -38,18 +38,18 @@ lazy val core = crossProject(JVMPlatform)
.settings(
name := "scalanews",
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "2.10.0",
"org.typelevel" %% "cats-core" % "2.12.0",
"org.typelevel" %% "cats-effect" % "3.5.4",
"com.monovore" %% "decline-effect" % "2.4.1",
"com.github.pureconfig" %% "pureconfig-core" % "0.17.6",
"com.github.pureconfig" %% "pureconfig-cats-effect" % "0.17.6",
"org.http4s" %% "http4s-ember-client" % "0.23.26",
"org.http4s" %% "http4s-dsl" % "0.23.26",
"co.fs2" %% "fs2-core" % "3.10.2",
"co.fs2" %% "fs2-io" % "3.10.2",
"com.github.pureconfig" %% "pureconfig-core" % "0.17.7",
"com.github.pureconfig" %% "pureconfig-cats-effect" % "0.17.7",
"org.http4s" %% "http4s-ember-client" % "0.23.28",
"org.http4s" %% "http4s-dsl" % "0.23.28",
"co.fs2" %% "fs2-core" % "3.11.0",
"co.fs2" %% "fs2-io" % "3.11.0",
"com.rometools" % "rome" % "2.1.0",
"org.scalameta" %% "munit" % "1.0.0-RC1" % Test,
"org.typelevel" %% "munit-cats-effect" % "2.0.0-M5" % Test
"org.scalameta" %% "munit" % "1.0.2" % Test,
"org.typelevel" %% "munit-cats-effect" % "2.0.0" % Test
),
Compile / mainClass := Some("com.softinio.scalanews.Main"),
nativeImageVersion := "21.0.1",
Expand Down
1 change: 0 additions & 1 deletion core/src/main/scala/com/softinio/scalanews/Bloggers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package com.softinio.scalanews
import java.util.Date
import cats.effect.*
import fs2.io.file.*
import fs2.Stream
import com.rometools.rome.feed.synd.SyndEntry

import scala.jdk.CollectionConverters.*
Expand Down
83 changes: 18 additions & 65 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 18 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
flake-utils.follows = "typelevel-nix/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, typelevel-nix }:
flake-utils.lib.eachDefaultSystem (system:
outputs =
{
self,
nixpkgs,
flake-utils,
typelevel-nix,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ typelevel-nix.overlay ];
overlays = [ typelevel-nix.overlays.default ];
};
in
{
Expand All @@ -23,14 +30,14 @@
};
commands = [
{
name = "ni";
category = "development";
help = "Create new scalanews executable";
command = ''
sbt coreJVM/nativeImage
chmod +x scalanews
./scalanews --help
'';
name = "ni";
category = "development";
help = "Create new scalanews executable";
command = ''
sbt coreJVM/nativeImage
chmod +x scalanews
./scalanews --help
'';
}
];
};
Expand Down
5 changes: 3 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "2.0.2")
addSbtPlugin("org.scalameta" % "sbt-native-image" % "0.3.4")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.0")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.7.0")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.3")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.7.3")
addDependencyTreePlugin

0 comments on commit cb5e388

Please sign in to comment.