Skip to content

Commit 5b612bc

Browse files
Merge pull request #98 from alexarchambault/default-windows-runner
Give GitHub's own Windows runner another try
2 parents d2d31a3 + 327fdeb commit 5b612bc

File tree

103 files changed

+42
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+42
-142
lines changed

.github/scripts/generate-docker-images-ubuntu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -eu
33

4-
launcherMillCommand="cli-core.nativeImageMostlyStatic"
4+
launcherMillCommand="cli.nativeImageMostlyStatic"
55
launcherName="scala"
66
mill="./mill"
77

.github/scripts/generate-os-packages.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@ packager() {
1515
}
1616

1717
launcher() {
18-
local launcherMillCommand
18+
local launcherMillCommand="cli.nativeImage"
1919
local launcherName
2020

21-
if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "msys" ]]; then
22-
# requires less memory - to be used when memory is tight on the CI
23-
launcherMillCommand="cli-core.nativeImage"
24-
else
25-
launcherMillCommand="cli.nativeImage"
26-
fi
27-
2821
if [[ "$OSTYPE" == "msys" ]]; then
2922
launcherName="scala.exe"
3023
else

.github/workflows/ci.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ on:
99
workflow_dispatch:
1010

1111
jobs:
12-
trigger-vm:
13-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'VirtuslabRnD/scala-cli'
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: azure/login@v1
17-
with:
18-
creds: '{"clientId": "42e79051-affb-4895-b54a-56a90bc4d86b", "clientSecret": "${{ secrets.SCALA3_CLIENT_SECRET }}", "subscriptionId": "da0a842a-c933-47fd-a4db-2d1a06fbafee","tenantId": "d09acba4-fb14-464d-851a-44a7cf8a064d","activeDirectoryEndpointUrl": "https://login.microsoftonline.com", "resourceManagerEndpointUrl": "https://management.azure.com/","activeDirectoryGraphResourceId": "https://graph.windows.net/", "sqlManagementEndpointUrl": "https://management.core.windows.net:8443/", "galleryEndpointUrl": "https://gallery.azure.com/", "managementEndpointUrl": "https://management.core.windows.net/"}'
19-
- run: |
20-
az vm start -g gh-runners -n scala-3-cli
21-
2212
jvm-tests:
2313
runs-on: ${{ matrix.OS }}
2414
strategy:
@@ -55,14 +45,7 @@ jobs:
5545
strategy:
5646
fail-fast: false
5747
matrix:
58-
OS: [[ self-hosted, windows, scala-3-cli ]]
59-
needsVirtuslabRepo: ["${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'VirtuslabRnD/scala-cli' }}"]
60-
include:
61-
- {OS: ubuntu-latest, needsVirtuslabRepo: false}
62-
- {OS: macos-latest, needsVirtuslabRepo: false}
63-
exclude:
64-
- OS: [ self-hosted, windows, scala-3-cli ]
65-
needsVirtuslabRepo: false
48+
OS: ["ubuntu-latest", "macos-latest", "windows-2016"]
6649
steps:
6750
- uses: actions/checkout@v2
6851
with:
@@ -86,7 +69,6 @@ jobs:
8669
if-no-files-found: error
8770
retention-days: 2
8871
- name: Native integration tests
89-
if: runner.os != 'Windows' || (github.event_name == 'push' && github.ref == 'refs/heads/master')
9072
run: ./mill -i nativeIntegrationTests
9173

9274
native-mostly-static-tests:
@@ -101,7 +83,7 @@ jobs:
10183
with:
10284
jvm: 8
10385
- name: Generate native launcher
104-
run: ./mill -i show cli-core.nativeImageMostlyStatic
86+
run: ./mill -i show cli.nativeImageMostlyStatic
10587
- name: Build docker image
10688
run: .github/scripts/generate-docker-images-ubuntu.sh
10789
- name: Copy artifacts
@@ -113,7 +95,7 @@ jobs:
11395
if-no-files-found: error
11496
retention-days: 2
11597
- name: Native integration tests
116-
run: ./mill -i integration-core.native-mostly-static.test
98+
run: ./mill -i integration.native-mostly-static.test
11799
- name: Docker integration tests
118100
run: ./mill integration.docker.test
119101
- name: Login to GitHub Container Registry
@@ -141,7 +123,7 @@ jobs:
141123
with:
142124
jvm: 8
143125
- name: Generate native launcher
144-
run: ./mill -i show cli-core.nativeImageStatic
126+
run: ./mill -i show cli.nativeImageStatic
145127
- name: Copy artifacts
146128
run: ./mill -i copyStaticLauncher artifacts/
147129
- uses: actions/[email protected]
@@ -151,7 +133,7 @@ jobs:
151133
if-no-files-found: error
152134
retention-days: 2
153135
- name: Native integration tests
154-
run: ./mill -i integration-core.native-static.test
136+
run: ./mill -i integration.native-static.test
155137

156138
checks:
157139
runs-on: ubuntu-latest

build.sc

Lines changed: 35 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -21,64 +21,44 @@ implicit def millModuleBasePath: define.BasePath =
2121

2222

2323
object cli extends Cli
24-
object `cli-core` extends CliCore
2524
object build extends Cross[Build] (Scala.defaultInternal)
2625
object stubs extends JavaModule with ScalaCliPublishModule
2726
object runner extends Cross[Runner] (Scala.all: _*)
2827
object `test-runner` extends Cross[TestRunner] (Scala.all: _*)
2928
object `bloop-rifle` extends Cross[BloopRifle] (Scala.allScala2: _*)
3029
object `tasty-lib` extends Cross[TastyLib] (Scala.all: _*)
3130

32-
object `integration-core` extends Module {
33-
object jvm extends JvmIntegrationCore {
31+
object integration extends Module {
32+
object docker extends CliIntegrationDocker {
33+
object test extends Tests {
34+
def sources = T.sources {
35+
super.sources() ++ integration.jvm.sources()
36+
}
37+
}
38+
}
39+
object jvm extends JvmIntegration {
3440
object test extends Tests
3541
}
36-
object native extends NativeIntegrationCore with Bloop.Module {
42+
object native extends NativeIntegration with Bloop.Module {
3743
def skipBloop = true
3844
object test extends Tests with Bloop.Module {
3945
def skipBloop = true
4046
}
4147
}
42-
object `native-static` extends NativeIntegrationCoreStatic with Bloop.Module {
48+
object `native-static` extends NativeIntegrationStatic with Bloop.Module {
4349
def skipBloop = true
4450
object test extends Tests with Bloop.Module {
4551
def skipBloop = true
4652
}
4753
}
48-
object `native-mostly-static` extends NativeIntegrationCoreMostlyStatic with Bloop.Module {
54+
object `native-mostly-static` extends NativeIntegrationMostlyStatic with Bloop.Module {
4955
def skipBloop = true
5056
object test extends Tests with Bloop.Module {
5157
def skipBloop = true
5258
}
5359
}
5460
}
5561

56-
object integration extends Module {
57-
object docker extends CliIntegrationDockerCore {
58-
object test extends Tests {
59-
def sources = T.sources {
60-
super.sources() ++ `integration-core`.jvm.sources()
61-
}
62-
}
63-
}
64-
object jvm extends JvmIntegration {
65-
object test extends Tests {
66-
def sources = T.sources {
67-
super.sources() ++ `integration-core`.jvm.test.sources()
68-
}
69-
}
70-
}
71-
object native extends NativeIntegration with Bloop.Module {
72-
def skipBloop = true
73-
object test extends Tests with Bloop.Module {
74-
def skipBloop = true
75-
def sources = T.sources {
76-
super.sources() ++ `integration-core`.native.test.sources()
77-
}
78-
}
79-
}
80-
}
81-
8262
object packager extends ScalaModule with Bloop.Module {
8363
def skipBloop = true
8464
def scalaVersion = Scala.scala213
@@ -216,23 +196,7 @@ class Build(val crossScalaVersion: String) extends CrossSbtModule with ScalaCliP
216196
}
217197
}
218198

219-
trait Cli extends SbtModule with CliLaunchers with ScalaCliPublishModule with FormatNativeImageConf with HasTests {
220-
def scalaVersion = Scala.defaultInternal
221-
def moduleDeps = Seq(
222-
`cli-core`
223-
)
224-
def compileIvyDeps = super.compileIvyDeps() ++ Agg(
225-
Deps.svm
226-
)
227-
def mainClass = Some("scala.cli.ScalaCli")
228-
229-
def localRepoJar = `local-repo`.localRepoJar()
230-
def graalVmVersion = deps.graalVmVersion
231-
232-
object test extends Tests
233-
}
234-
235-
trait CliCore extends SbtModule with CliLaunchers with ScalaCliPublishModule with FormatNativeImageConf with HasMacroAnnotations {
199+
trait Cli extends SbtModule with CliLaunchers with ScalaCliPublishModule with FormatNativeImageConf with HasTests with HasMacroAnnotations {
236200
def scalaVersion = Scala.defaultInternal
237201
def moduleDeps = Seq(
238202
build(Scala.defaultInternal),
@@ -251,10 +215,12 @@ trait CliCore extends SbtModule with CliLaunchers with ScalaCliPublishModule wit
251215
def compileIvyDeps = super.compileIvyDeps() ++ Agg(
252216
Deps.svm
253217
)
254-
def mainClass = Some("scala.cli.ScalaCliCore")
218+
def mainClass = Some("scala.cli.ScalaCli")
255219

256220
def localRepoJar = `local-repo`.localRepoJar()
257221
def graalVmVersion = deps.graalVmVersion
222+
223+
object test extends Tests
258224
}
259225

260226
trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTests {
@@ -270,7 +236,7 @@ trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTe
270236
val name = mainArtifactName().stripPrefix(prefix)
271237
val baseIntegrationPath = os.Path(millSourcePath.toString.stripSuffix(name))
272238
val modulesPath = os.Path(baseIntegrationPath.toString.stripSuffix(baseIntegrationPath.baseName))
273-
val mainPath = PathRef(modulesPath / "integration-core" / "src" / "main" / "scala")
239+
val mainPath = PathRef(modulesPath / "integration" / "src" / "main" / "scala")
274240
super.sources() ++ Seq(mainPath)
275241
}
276242

@@ -330,7 +296,7 @@ trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTe
330296
}
331297
}
332298

333-
trait CliIntegrationDockerCore extends SbtModule with ScalaCliPublishModule with HasTests {
299+
trait CliIntegrationDocker extends SbtModule with ScalaCliPublishModule with HasTests {
334300
def scalaVersion = Scala.scala213
335301
def ivyDeps = super.ivyDeps() ++ Agg(
336302
Deps.osLib
@@ -341,37 +307,23 @@ trait CliIntegration extends CliIntegrationBase {
341307
def prefix = "integration-"
342308
}
343309

344-
trait CliIntegrationCore extends CliIntegration {
345-
def prefix = "integration-core-"
346-
}
347-
348310
trait NativeIntegration extends CliIntegration {
349311
def testLauncher = cli.nativeImage()
350312
def cliKind = "native"
351313
}
352314

353-
trait JvmIntegration extends CliIntegration {
354-
def testLauncher = cli.launcher()
355-
def cliKind = "jvm"
356-
}
357-
358-
trait NativeIntegrationCore extends CliIntegrationCore {
359-
def testLauncher = `cli-core`.nativeImage()
360-
def cliKind = "native"
361-
}
362-
363-
trait NativeIntegrationCoreStatic extends CliIntegrationCore {
364-
def testLauncher = `cli-core`.nativeImageStatic()
315+
trait NativeIntegrationStatic extends CliIntegration {
316+
def testLauncher = cli.nativeImageStatic()
365317
def cliKind = "native-static"
366318
}
367319

368-
trait NativeIntegrationCoreMostlyStatic extends CliIntegrationCore {
369-
def testLauncher = `cli-core`.nativeImageMostlyStatic()
320+
trait NativeIntegrationMostlyStatic extends CliIntegration {
321+
def testLauncher = cli.nativeImageMostlyStatic()
370322
def cliKind = "native-mostly-static"
371323
}
372324

373-
trait JvmIntegrationCore extends CliIntegrationCore {
374-
def testLauncher = `cli-core`.launcher()
325+
trait JvmIntegration extends CliIntegration {
326+
def testLauncher = cli.launcher()
375327
def cliKind = "jvm"
376328
}
377329

@@ -498,16 +450,6 @@ def copyLauncher(directory: String = "artifacts") = T.command {
498450
)
499451
}
500452

501-
def copyCoreLauncher(directory: String = "artifacts") = T.command {
502-
val nativeLauncher = `cli-core`.nativeImage().path
503-
Upload.copyLauncher(
504-
nativeLauncher,
505-
directory,
506-
"scala-cli",
507-
compress = true
508-
)
509-
}
510-
511453
def copyJvmLauncher(directory: String = "artifacts") = T.command {
512454
val launcher = cli.standaloneLauncher().path
513455
os.copy(launcher, os.Path(directory, os.pwd) / s"scala-cli$platformExecutableJarExtension", createFolders = true, replaceExisting = true)
@@ -538,40 +480,23 @@ def scala(args: String*) = T.command {
538480
cli.run(args: _*)()
539481
}
540482

541-
def tightMemory = Properties.isLinux || Properties.isWin
542-
543483
def defaultNativeImage() =
544-
if (tightMemory)
545-
T.command {
546-
`cli-core`.nativeImage()
547-
}
548-
else
549-
T.command {
550-
cli.nativeImage()
551-
}
484+
T.command {
485+
cli.nativeImage()
486+
}
552487

553488
def nativeIntegrationTests() =
554-
if (tightMemory)
555-
T.command {
556-
`integration-core`.native.test.test()()
557-
}
558-
else
559-
T.command {
560-
integration.native.test.test()()
561-
}
489+
T.command {
490+
integration.native.test.test()()
491+
}
562492

563493
def copyDefaultLauncher(directory: String = "artifacts") =
564-
if (tightMemory)
565-
T.command {
566-
copyCoreLauncher(directory)()
567-
}
568-
else
569-
T.command {
570-
copyLauncher(directory)()
571-
}
494+
T.command {
495+
copyLauncher(directory)()
496+
}
572497

573498
def copyMostlyStaticLauncher(directory: String = "artifacts") = T.command {
574-
val nativeLauncher = `cli-core`.nativeImageMostlyStatic().path
499+
val nativeLauncher = cli.nativeImageMostlyStatic().path
575500
Upload.copyLauncher(
576501
nativeLauncher,
577502
directory,
@@ -582,7 +507,7 @@ def copyMostlyStaticLauncher(directory: String = "artifacts") = T.command {
582507
}
583508

584509
def copyStaticLauncher(directory: String = "artifacts") = T.command {
585-
val nativeLauncher = `cli-core`.nativeImageStatic().path
510+
val nativeLauncher = cli.nativeImageStatic().path
586511
Upload.copyLauncher(
587512
nativeLauncher,
588513
directory,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)