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

Enables lockfile workflow with sbt-dependency-lock #153

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
10 changes: 7 additions & 3 deletions .github/.scala-steward.conf
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ updates.ignore = [ { groupId = "org.scala-lang", artifactId = "scala-library" }

# If set, Scala Steward will use this message template for the commit messages and PR titles.
# Supported variables: ${artifactName}, ${currentVersion}, ${nextVersion} and ${default}
# Default: "${default}" which is equivalent to "Update ${artifactName} to ${nextVersion}"
# Default: "${default}" which is equivalent to "Update ${artifactName} to ${nextVersion}"
commits.message = "Update ${artifactName} from ${currentVersion} to ${nextVersion}"

# If true and when upgrading version in .scalafmt.conf, Scala Steward will perform scalafmt
# If true and when upgrading version in .scalafmt.conf, Scala Steward will perform scalafmt
# and add a separate commit when format changed. So you don't need reformat manually and can merge PR.
# If false, Scala Steward will not perform scalafmt, so your CI may abort when reformat needed.
# Default: true
Expand All @@ -90,9 +90,13 @@ scalafmt.runAfterUpgrading = false
# groupId = "com.github.sbt",
# artifactId = "sbt-protobuf"
# }]
postUpdateHooks = [{
command = ["sbt", "dependencyLockWrite"],
commitMessage = "Regenerated sbt lock file"
}]

# You can override some config options for dependencies that matches the given pattern.
# Currently, "pullRequests" can be overridden.
# Currently, "pullRequests" can be overridden.
# Each pattern must have `groupId`, and may have `artifactId` and `version`.
# First-matched entry is used.
# More-specific entry should be placed before less-specific entry.
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ jobs:
extraKey: ${{ runner.os }}
- uses: coursier/setup-action@v1
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
jvm: adopt:1.8
- name: Build, test, and package project on Spark 3.5
run: bin/sbt clean compile test package makePom -DsparkVersion=3.5.1
run: bin/sbt clean update dependencyLockCheck compile test package makePom -DsparkVersion=3.5.1
- name: Build and package project on "legacy" Spark
run: bin/sbt clean compile package makePom
run: bin/sbt clean update dependencyLockCheck compile package makePom
12 changes: 10 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,17 @@ jobs:
extraKey: ${{ runner.os }}
- uses: coursier/setup-action@v1
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
jvm: adopt:1.8
# uses sbt-github-packages, see build.sbt
- name: Publish with SBT
run: bin/sbt publish
run: bin/sbt dependencyLockCheck publish
- name: Publish with SBT
run: bin/sbt publish -DsparkVersion=3.5.1
run: bin/sbt dependencyLockCheck publish -DsparkVersion=3.5.1
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@ test: ## Runs tests
check: ## Runs linters and other checks
$(SBT) scalastyle

.PHONY: check-deps
check-deps: ## Checks dependencies are what are expected
$(SBT) dependencyLockCheck

.PHONY: build
build:
$(SBT) assembly

.PHONY: relock
relock: ## Lock dependencies based on what's currently referenced
$(SBT) dependencyLockWrite

.PHONY: format-scala
format-scala: ## Formats all Scala code
$(SBT) scalafmt
Expand Down
Loading
Loading