Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripted on GitHub Action #53

Closed
wants to merge 2 commits into from
Closed
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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Continuous Integration

on:
pull_request:
branches: ['**']
push:
branches: ['**']
tags: [v*]

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

jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
cache: sbt

- shell: bash
run: sbt compile

- shell: bash
run: sbt sbt-paradox-material-theme/scripted
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ lazy val root = project("paradox-material-theme-parent", file("."))
Compile / paradoxNavigationDepth := 3,
makeSite := makeSite.dependsOn(Compile / paradox).value,
paradoxMaterialTheme / version := version.value,
// this is to avoid triggering update, which will fail
Compile / compile := sbt.internal.inc.Analysis.empty,
Comment on lines +14 to +15
Copy link
Member Author

Choose a reason for hiding this comment

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

@mdedetrich @mkurz Here's my hypothesis on the mysterious behavior. This build uses intertwined dependency pattern wherein the build itself uses the sbt plugin defined in the build, and specifically the root subproject enables ParadoxMaterialThemePlugin.

So while the root subproject does not contain any Scala source, compile will trigger an update at the root-level, which likely triggers the dependency resolution against theme version 0.6.0-SNAPSHOT, which doesn't exist yet. I don't know if the missing / is actually true, or some other red herring bug. In any case, the above demonstrates that short-circuiting the root Compile / compile fixes the issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for looking into this! I will update the original PR and give you credit for it

Compile / paradoxProperties ++= Map(
"project.name" -> "Paradox Material Theme",
"github.base_url" -> "https://github.com/sbt/sbt-paradox-material-theme"
Expand Down Expand Up @@ -70,7 +72,6 @@ lazy val plugin = project("sbt-paradox-material-theme", file("plugin"))
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.4.4"),
libraryDependencies += "org.jsoup" % "jsoup" % "1.10.3",
libraryDependencies += "io.circe" %% "circe-core" % "0.9.3",
update := update.dependsOn(theme / publishLocal).value,
Copy link
Contributor

@mdedetrich mdedetrich Feb 11, 2024

Choose a reason for hiding this comment

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

So this was put in deliberately because otherwise you cannot compile/update the project locally, see #45.

So I don't what to do here, it seems like a catch 22.

At least you found out what's causing the issue although I am still somewhat perplexed as to why this is screwing with the resolver in the CI.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mkurz Does this help trigger your memories wrt #48 (comment) ?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, can't remember. Great you solved this meanwhile 👍

Compile / resourceGenerators += Def.task {
val file = (Compile / resourceManaged).value / "paradox-material-theme.properties"
IO.write(file, s"version=${version.value}")
Expand Down
Loading