Skip to content

Commit 6c82d0c

Browse files
hamzaremmalHarrisL2
authored andcommitted
chore: add support for sbt scripted tests in the new build
1 parent 2acc2de commit 6c82d0c

File tree

3 files changed

+114
-49
lines changed

3 files changed

+114
-49
lines changed

.github/workflows/ci.yaml

Lines changed: 96 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,99 @@ env:
5151
# text on stderr and so can break tests which check the output of a program).
5252

5353
jobs:
54+
test:
55+
runs-on: [self-hosted, Linux]
56+
container:
57+
image: lampepfl/dotty:2024-10-18
58+
options: --cpu-shares 4096
59+
volumes:
60+
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
61+
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
62+
- ${{ github.workspace }}/../../cache/general:/root/.cache
63+
if: "github.event_name == 'schedule' && github.repository == 'scala/scala3'
64+
|| github.event_name == 'push'
65+
|| github.event_name == 'merge_group'
66+
|| (
67+
github.event_name == 'pull_request'
68+
&& !contains(github.event.pull_request.body, '[skip ci]')
69+
&& !contains(github.event.pull_request.body, '[skip test]')
70+
)
71+
|| (
72+
github.event_name == 'workflow_dispatch'
73+
&& github.repository == 'scala/scala3'
74+
)"
75+
76+
steps:
77+
- name: Set JDK 17 as default
78+
run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH
79+
80+
- name: Reset existing repo
81+
run: |
82+
git config --global --add safe.directory $GITHUB_WORKSPACE
83+
git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true
84+
85+
- name: Checkout cleanup script
86+
uses: actions/checkout@v5
87+
88+
- name: Cleanup
89+
run: .github/workflows/cleanup.sh
90+
91+
- name: Git Checkout
92+
uses: actions/checkout@v5
93+
94+
- name: Add SBT proxy repositories
95+
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
96+
97+
- name: Cmd Tests
98+
run: |
99+
./project/scripts/buildScalaBinary
100+
./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/publishLocal ;scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
101+
./project/scripts/cmdTests
102+
./project/scripts/bootstrappedOnlyCmdTests
103+
104+
test_windows_fast:
105+
runs-on: [self-hosted, Windows]
106+
if: "(
107+
github.event_name == 'push'
108+
&& github.ref != 'refs/heads/main'
109+
)
110+
|| github.event_name == 'merge_group'
111+
|| (
112+
github.event_name == 'pull_request'
113+
&& !contains(github.event.pull_request.body, '[skip ci]')
114+
&& !contains(github.event.pull_request.body, '[skip test_windows_fast]')
115+
)"
116+
117+
steps:
118+
- name: Reset existing repo
119+
shell: cmd
120+
run: |
121+
git config --global --add safe.directory $GITHUB_WORKSPACE
122+
git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true
123+
124+
- name: Git Checkout
125+
uses: actions/checkout@v5
126+
127+
- name: Test
128+
run: sbt ";scala3-bootstrapped/compile; scala3-presentation-compiler/test; scala3-language-server/test"
129+
shell: cmd
130+
131+
- name: build binary
132+
run: sbt "dist-win-x86_64/Universal/stage" & bash -version
133+
shell: cmd
134+
135+
- name: cygwin tests
136+
run: '"C:\Program Files\cygwin64\bin\bash" ./project/scripts/winCmdTests'
137+
shell: cmd
138+
139+
- name: msys tests
140+
run: '"C:\Program Files\Git\bin\bash" ./project/scripts/winCmdTests'
141+
shell: cmd
142+
143+
- name: win tests
144+
run: './project/scripts/winCmdTests.bat'
145+
shell: cmd
146+
54147
test_windows_full:
55148
runs-on: [self-hosted, Windows]
56149
if: "github.event_name == 'schedule' && github.repository == 'scala/scala3'
@@ -246,51 +339,6 @@ jobs:
246339
if: ${{ always() }}
247340
run: cat community-build/dotty-community-build-deps || true
248341

249-
test_sbt:
250-
runs-on: [self-hosted, Linux]
251-
container:
252-
image: lampepfl/dotty:2024-10-18
253-
options: --cpu-shares 4096
254-
volumes:
255-
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
256-
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
257-
- ${{ github.workspace }}/../../cache/general:/root/.cache
258-
if: "github.event_name == 'schedule' && github.repository == 'scala/scala3'
259-
|| github.event_name == 'push'
260-
|| (
261-
github.event_name == 'pull_request'
262-
&& !contains(github.event.pull_request.body, '[skip ci]')
263-
&& !contains(github.event.pull_request.body, '[skip test_sbt]')
264-
)
265-
|| (
266-
github.event_name == 'workflow_dispatch'
267-
&& github.repository == 'scala/scala3'
268-
)"
269-
270-
steps:
271-
- name: Set JDK 17 as default
272-
run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH
273-
274-
- name: Reset existing repo
275-
run: |
276-
git config --global --add safe.directory $GITHUB_WORKSPACE
277-
git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true
278-
279-
- name: Checkout cleanup script
280-
uses: actions/checkout@v5
281-
282-
- name: Cleanup
283-
run: .github/workflows/cleanup.sh
284-
285-
- name: Git Checkout
286-
uses: actions/checkout@v5
287-
288-
- name: Add SBT proxy repositories
289-
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
290-
291-
- name: Test sbt
292-
run: ./project/scripts/sbt "sbt-test/scripted"
293-
294342
publish_release:
295343
permissions:
296344
contents: write # for GH CLI to create a release
@@ -302,7 +350,9 @@ jobs:
302350
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
303351
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
304352
- ${{ github.workspace }}/../../cache/general:/root/.cache
305-
if: "github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')"
353+
needs: [test, community_build_a, community_build_b, community_build_c, build-sdk-package, build-msi-package]
354+
if: "github.event_name == 'push'
355+
&& startsWith(github.event.ref, 'refs/tags/')"
306356

307357
env:
308358
RELEASEBUILD: yes

.github/workflows/stdlib.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,3 +722,20 @@ jobs:
722722
- name: Run Community Build C
723723
run: |
724724
./project/scripts/sbt "community-build/testOnly dotty.communitybuild.CommunityBuildTestC"
725+
726+
scripted-tests:
727+
runs-on: ubuntu-latest
728+
needs: [scala3-compiler-bootstrapped, tasty-core-bootstrapped, scala3-staging, scala3-tasty-inspector, scala-library-sjs, scaladoc]
729+
steps:
730+
- name: Git Checkout
731+
uses: actions/checkout@v5
732+
733+
- name: Set up JDK 17
734+
uses: actions/setup-java@v5
735+
with:
736+
distribution: 'temurin'
737+
java-version: 17
738+
cache: 'sbt'
739+
- uses: sbt/setup-sbt@v1
740+
- name: Run SBT scripted tests
741+
run: ./project/scripts/sbt scala3-bootstrapped-new/scripted

project/Build.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,6 @@ object Build {
800800
// ==============================================================================================
801801

802802
lazy val `scala3-bootstrapped-new` = project
803-
.enablePlugins(ScriptedPlugin)
804803
.aggregate(`scala3-interfaces`, `scala3-library-bootstrapped-new` , `scala-library-bootstrapped`,
805804
`tasty-core-bootstrapped-new`, `scala3-compiler-bootstrapped-new`, `scala3-sbt-bridge-bootstrapped`,
806805
`scala3-staging-new`, `scala3-tasty-inspector-new`, `scala-library-sjs`, `scala3-library-sjs`,
@@ -897,7 +896,7 @@ object Build {
897896
scriptedBatchExecution := true,
898897
scriptedLaunchOpts ++= Seq(
899898
s"-Dplugin.scalaVersion=${dottyVersion}",
900-
s"-Dplugin.scala2Version=2.13.16",
899+
s"-Dplugin.scala2Version=${stdlibVersion(Bootstrapped)}",
901900
s"-Dplugin.scalaJSVersion=${scalaJSVersion}",
902901
),
903902
scriptedBufferLog := true,
@@ -913,7 +912,6 @@ object Build {
913912
(`scala3-staging-new` / publishLocalBin),
914913
(`scala3-tasty-inspector-new` / publishLocalBin),
915914
(`scaladoc-new` / publishLocalBin),
916-
(`scala3-repl` / publishLocalBin),
917915
publishLocalBin,
918916
).evaluated,
919917
)

0 commit comments

Comments
 (0)