Skip to content
Open
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
49 changes: 2 additions & 47 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Cmd Tests
run: |
./project/scripts/buildScalaBinary
./project/scripts/sbt ";scala3-bootstrapped/compile ;sbt-test/scripted scala2-compat/* ;scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
./project/scripts/cmdTests
./project/scripts/bootstrappedOnlyCmdTests

Expand Down Expand Up @@ -339,51 +339,6 @@ jobs:
if: ${{ always() }}
run: cat community-build/dotty-community-build-deps || true

test_sbt:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2024-10-18
options: --cpu-shares 4096
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
if: "github.event_name == 'schedule' && github.repository == 'scala/scala3'
|| github.event_name == 'push'
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip test_sbt]')
)
|| (
github.event_name == 'workflow_dispatch'
&& github.repository == 'scala/scala3'
)"

steps:
- name: Set JDK 17 as default
run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH

- name: Reset existing repo
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true

- name: Checkout cleanup script
uses: actions/checkout@v5

- name: Cleanup
run: .github/workflows/cleanup.sh

- name: Git Checkout
uses: actions/checkout@v5

- name: Add SBT proxy repositories
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true

- name: Test sbt
run: ./project/scripts/sbt "sbt-test/scripted"

publish_release:
permissions:
contents: write # for GH CLI to create a release
Expand All @@ -395,7 +350,7 @@ jobs:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
needs: [test, community_build_a, community_build_b, community_build_c, test_sbt, build-sdk-package, build-msi-package]
needs: [test, community_build_a, community_build_b, community_build_c, build-sdk-package, build-msi-package]
if: "github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')"

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/scaladoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ jobs:
- name: Generate Scala 3 documentation
run: ./project/scripts/sbt scaladoc/generateScalaDocumentation

- name: Generate documentation for example project using dotty-sbt
run: ./project/scripts/sbt "sbt-test/scripted sbt-dotty/scaladoc"

Comment on lines -65 to -67
Copy link
Member Author

Choose a reason for hiding this comment

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

We will be running these alongside all the other scripted tests anyways, no need to run them twice.

stdlib-sourcelinks-test:
runs-on: ubuntu-latest
# if false - disable flaky test
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/stdlib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -539,3 +539,20 @@ jobs:
- name: Scala.js JUnit tests
run: ./project/scripts/sbt ";sjsJUnitTests/test ;set sjsJUnitTests/scalaJSLinkerConfig ~= switchToESModules ;sjsJUnitTests/test"
# TODO Scala.js on Windows

scripted-tests:
runs-on: ubuntu-latest
needs: [scala3-compiler-bootstrapped, tasty-core-bootstrapped, scala3-staging, scala3-tasty-inspector, scala-library-sjs, scaladoc]
steps:
- name: Git Checkout
uses: actions/checkout@v5

- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- name: Run SBT scripted tests
run: ./project/scripts/sbt scala3-bootstrapped-new/scripted
2 changes: 0 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,5 @@ val sjsSandbox = Build.sjsSandbox
val sjsJUnitTests = Build.sjsJUnitTests
val sjsCompilerTests = Build.sjsCompilerTests

val `sbt-test` = Build.`sbt-test`

inThisBuild(Build.thisBuildSettings)
inScope(Global)(Build.globalSettings)
70 changes: 28 additions & 42 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,7 @@ object Build {
// ==============================================================================================

lazy val `scala3-bootstrapped-new` = project
.enablePlugins(ScriptedPlugin)
.aggregate(`scala3-interfaces`, `scala3-library-bootstrapped-new` , `scala-library-bootstrapped`,
`tasty-core-bootstrapped-new`, `scala3-compiler-bootstrapped-new`, `scala3-sbt-bridge-bootstrapped`,
`scala3-staging-new`, `scala3-tasty-inspector-new`, `scala-library-sjs`, `scala3-library-sjs`, `scaladoc-new`)
Expand Down Expand Up @@ -1557,7 +1558,33 @@ object Build {
(if (args1.nonEmpty) " -Ddotty.tests.filter=" + args1.mkString(" ") else "")
(`scala3-compiler-bootstrapped-new` / Test / testOnly).toTask(cmd)
}
}.evaluated
}.evaluated,
// ================================ SBT SCRIPT TEST SETTINGS ================================
sbtTestDirectory := (ThisBuild / baseDirectory).value / "sbt-test",
// The batch mode accidentally became the default with no way to disable
// it in sbt 1.4 (https://github.com/sbt/sbt/issues/5913#issuecomment-716003195).
// We enable it explicitly here to make it clear that we're using it.
scriptedBatchExecution := true,
scriptedLaunchOpts ++= Seq(
s"-Dplugin.scalaVersion=${dottyVersion}",
s"-Dplugin.scala2Version=${stdlibVersion(Bootstrapped)}",
s"-Dplugin.scalaJSVersion=${scalaJSVersion}",
),
scriptedBufferLog := true,
scripted := scripted.dependsOn(
(`scala3-sbt-bridge-bootstrapped` / publishLocalBin),
(`scala3-interfaces` / publishLocalBin),
(`scala3-compiler-bootstrapped-new` / publishLocalBin),
(`scala3-library-bootstrapped-new` / publishLocalBin),
(`scala-library-bootstrapped` / publishLocalBin),
(`scala-library-sjs` / publishLocalBin),
(`scala3-library-sjs` / publishLocalBin),
(`tasty-core-bootstrapped-new` / publishLocalBin),
(`scala3-staging-new` / publishLocalBin),
(`scala3-tasty-inspector-new` / publishLocalBin),
(`scaladoc-new` / publishLocalBin),
publishLocalBin,
).evaluated,
)

/* Configuration of the org.scala-lang:scala3-sbt-bridge:*.**.**-bootstrapped project */
Expand Down Expand Up @@ -3507,47 +3534,6 @@ object Build {
BuildInfoPlugin.buildInfoScopedSettings(Test),
)

// various scripted sbt tests
lazy val `sbt-test` = project.in(file("sbt-test")).
enablePlugins(ScriptedPlugin).
settings(commonSettings).
settings(
sbtTestDirectory := baseDirectory.value,
target := baseDirectory.value / ".." / "out" / name.value,

// The batch mode accidentally became the default with no way to disable
// it in sbt 1.4 (https://github.com/sbt/sbt/issues/5913#issuecomment-716003195).
// We enable it explicitly here to make it clear that we're using it.
scriptedBatchExecution := true,

scriptedLaunchOpts ++= Seq(
"-Dplugin.version=" + version.value,
"-Dplugin.scalaVersion=" + dottyVersion,
"-Dplugin.scala2Version=" + stdlibVersion(Bootstrapped),
"-Dplugin.scalaJSVersion=" + scalaJSVersion,
"-Dsbt.boot.directory=" + ((ThisBuild / baseDirectory).value / ".sbt-scripted").getAbsolutePath // Workaround sbt/sbt#3469
),
// Pass along ivy home and repositories settings to sbt instances run from the tests
scriptedLaunchOpts ++= {
val repositoryPath = (io.Path.userHome / ".sbt" / "repositories").absolutePath
s"-Dsbt.repository.config=$repositoryPath" ::
ivyPaths.value.ivyHome.map("-Dsbt.ivy.home=" + _.getAbsolutePath).toList
},
scriptedBufferLog := true,
scripted := scripted.dependsOn(
(`scala3-sbt-bridge` / publishLocalBin),
(`scala3-interfaces` / publishLocalBin),
(`scala3-compiler-bootstrapped` / publishLocalBin),
(`scala3-library-bootstrapped` / publishLocalBin),
(`scala3-library-bootstrappedJS` / publishLocalBin),
(`tasty-core-bootstrapped` / publishLocalBin),
(`scala3-staging` / publishLocalBin),
(`scala3-tasty-inspector` / publishLocalBin),
(`scaladoc` / publishLocalBin),
(`scala3-bootstrapped` / publishLocalBin) // Needed because sbt currently hardcodes the dotty artifact
).evaluated
)

val prepareCommunityBuild = taskKey[Unit]("Publish local the compiler and the sbt plugin. Also store the versions of the published local artefacts in two files, community-build/{scala3-bootstrapped.version,sbt-injected-plugins}.")

lazy val `community-build` = project.in(file("community-build")).
Expand Down
Loading