Skip to content

Commit 425b3f9

Browse files
authored
[CI] fix issue with runninf scala-cli scripts (#1752)
try to pin scala in scala-cli more hacking Update VerifyJDK9Classes.scala Update verify-jdk9-classes.sh update revert some changes Update nightly-builds.yml Update nightly-builds.yml
1 parent 9abe420 commit 425b3f9

File tree

3 files changed

+9
-35
lines changed

3 files changed

+9
-35
lines changed

.github/workflows/nightly-builds.yml

+1-27
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@ jobs:
5454
-Dmultinode.XX:+AlwaysActAsServerClassMachine \
5555
clean cluster-metrics/test
5656
57-
# comment out test report until an apache or GitHub published action (action-surefire-report) can be found or added allowlist from INFRA
58-
# - name: Test Reports
59-
# # Makes it easier to spot failures instead of looking at the logs.
60-
# if: ${{ failure() }}
61-
# uses: marcospereira/action-surefire-report@v1
62-
# with:
63-
# report_paths: '**/target/test-reports/TEST-*.xml'
64-
# fail_if_no_tests: false
65-
# skip_publishing: true
66-
6757
pekko-classic-remoting-tests:
6858
name: Pekko Classic Remoting Tests
6959
runs-on: ubuntu-22.04
@@ -166,23 +156,6 @@ jobs:
166156
-Dio.netty.leakDetection.level=PARANOID \
167157
clean "++ ${{ matrix.scalaVersion }} test" checkTestsHaveRun
168158
169-
# comment out test report until an apache or GitHub published action (action-surefire-report) can be found or added allowlist from INFRA
170-
# - name: Test Reports
171-
# # Makes it easier to spot failures instead of looking at the logs.
172-
# if: ${{ failure() }}
173-
# uses: marcospereira/action-surefire-report@v1
174-
# with:
175-
# report_paths: '**/target/test-reports/TEST-*.xml'
176-
# fail_if_no_tests: false
177-
178-
# # Archive test results so we can do some diagnostics later
179-
# - name: Upload test results
180-
# uses: actions/upload-artifact@v2
181-
# if: success() || failure() # run this step even if previous step failed
182-
# with:
183-
# name: test-results-${{ matrix.javaVersion }}-${{ matrix.scalaVersion }}
184-
# path: '**/target/test-reports/TEST-*.xml'
185-
186159
- name: Docs
187160
# Docs generation requires JDK 11.
188161
if: ${{ matrix.javaVersion == 11 }}
@@ -204,6 +177,7 @@ jobs:
204177
205178
- name: Install scala-cli
206179
if: ${{ matrix.javaVersion == 11 }}
180+
# uses: VirtusLab/scala-cli-setup@v1
207181
run: |-
208182
curl -sS "https://virtuslab.github.io/scala-cli-packages/KEY.gpg" | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/scala-cli.gpg 2>/dev/null
209183
sudo curl -s --compressed -o /etc/apt/sources.list.d/scala_cli_packages.list "https://virtuslab.github.io/scala-cli-packages/debian/scala_cli_packages.list"

.github/workflows/verify-jdk9-classes.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717
# specific language governing permissions and limitations
1818
# under the License.
1919

20-
echo "Checking Scala CLI version..."
21-
scala-cli --version
22-
2320
echo "Starting verification with Scala-CLI..."
2421

2522
for file in stream/target/scala-cli/*.sc; do
23+
cat $file
2624
echo "Starting verification for with file: $file."
2725
if scala-cli "$file" ; then
2826
echo "Verification successful for $file."

project/VerifyJDK9Classes.scala

+7-5
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ object VerifyJDK9Classes {
2929

3030
def generateAndWriteScalaCLIScript(dir: SettingKey[File]): Def.Initialize[Task[Seq[sbt.File]]] =
3131
Def.task[Seq[File]] {
32-
val binaryVersion = scalaBinaryVersion.value
33-
val script = generateScalaCLIScript(version.value, binaryVersion)
34-
val file = dir.value / "scala-cli" / s"VerifyJDK9Classes-${binaryVersion}.sc"
32+
val scalaVer = scalaVersion.value
33+
val script = generateScalaCLIScript(version.value, scalaVer)
34+
val file = dir.value / "scala-cli" / s"VerifyJDK9Classes-${scalaVer}.sc"
3535
val content = script.stripMargin.format(version.value)
3636
if (!file.exists || IO.read(file) != content) IO.write(file, content)
3737
// the generated file is not used.
@@ -40,6 +40,9 @@ object VerifyJDK9Classes {
4040

4141
private def generateScalaCLIScript(version: String, scalaBinaryVersion: String): String =
4242
s"""
43+
|//> using scala ${scalaBinaryVersion}
44+
|//> using dep "org.apache.pekko::pekko-stream:${version}"
45+
|
4346
|/*
4447
| * Licensed to the Apache Software Foundation (ASF) under one or more
4548
| * contributor license agreements. See the NOTICE file distributed with
@@ -56,8 +59,7 @@ object VerifyJDK9Classes {
5659
| * See the License for the specific language governing permissions and
5760
| * limitations under the License.
5861
| */
59-
|//> using scala ${scalaBinaryVersion}
60-
|//> using dep "org.apache.pekko::pekko-stream:${version}"
62+
|
6163
|object VerifyJDK9Classes {
6264
| def main(args: Array[String]): Unit = {
6365
| import org.apache.pekko.actor.ActorSystem

0 commit comments

Comments
 (0)