Skip to content

Commit f191265

Browse files
committed
add basic windows job settings
1 parent b7256bb commit f191265

File tree

2 files changed

+148
-10
lines changed

2 files changed

+148
-10
lines changed

.github/workflows/ci.yaml

+87-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111

1212
jobs:
1313
test:
14-
runs-on: [self-hosted, linux]
14+
runs-on: [self-hosted, Linux]
1515
container: lampepfl/dotty:2020-04-24
1616

1717
steps:
@@ -54,7 +54,7 @@ jobs:
5454
./project/scripts/cmdTests
5555
5656
test_bootstrapped:
57-
runs-on: [self-hosted, linux]
57+
runs-on: [self-hosted, Linux]
5858
container: lampepfl/dotty:2020-04-24
5959

6060
steps:
@@ -96,8 +96,85 @@ jobs:
9696
./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;configureIDE"
9797
./project/scripts/bootstrapCmdTests
9898
99+
100+
test-windows:
101+
runs-on: [self-hosted, Windows]
102+
container: lampepfl/dotty-windows:2020-10-02
103+
104+
steps:
105+
- name: Checkout cleanup script
106+
uses: actions/checkout@v2
107+
108+
- name: Cleanup
109+
bash: .github/workflows/cleanup.sh
110+
111+
- name: Git Checkout
112+
uses: actions/checkout@v2
113+
114+
- name: Cache Ivy
115+
uses: actions/[email protected]
116+
with:
117+
path: C:\.ivy2\cache
118+
key: ${{ runner.os }}-ivy-${{ hashFiles('**/build.sbt') }}
119+
restore-keys: ${{ runner.os }}-ivy-
120+
121+
- name: Cache SBT
122+
uses: actions/[email protected]
123+
with:
124+
path: C:\.sbt
125+
key: ${{ runner.os }}-sbt-${{ hashFiles('project/**') }}
126+
restore-keys: ${{ runner.os }}-sbt-
127+
128+
- name: Cache Coursier and Mill
129+
uses: actions/[email protected]
130+
with:
131+
path: C:\.cache
132+
key: ${{ runner.os }}-general-${{ hashFiles('**/build.sbt') }}
133+
restore-keys: ${{ runner.os }}-general-
134+
135+
- name: Test
136+
run: sbt ";compile ;test"
137+
138+
test_bootstrapped-windows:
139+
runs-on: [self-hosted, Windows]
140+
container: lampepfl/dotty-windows:2020-10-02
141+
142+
steps:
143+
- name: Checkout cleanup script
144+
uses: actions/checkout@v2
145+
146+
- name: Cleanup
147+
bash: .github/workflows/cleanup.sh
148+
149+
- name: Git Checkout
150+
uses: actions/checkout@v2
151+
152+
- name: Cache Ivy
153+
uses: actions/[email protected]
154+
with:
155+
path: C:\.ivy2\cache
156+
key: ${{ runner.os }}-ivy-${{ hashFiles('**/build.sbt') }}
157+
restore-keys: ${{ runner.os }}-ivy-
158+
159+
- name: Cache SBT
160+
uses: actions/[email protected]
161+
with:
162+
path: C:\.sbt
163+
key: ${{ runner.os }}-sbt-${{ hashFiles('project/**') }}
164+
restore-keys: ${{ runner.os }}-sbt-
165+
166+
- name: Cache Coursier and Mill
167+
uses: actions/[email protected]
168+
with:
169+
path: C:\.cache
170+
key: ${{ runner.os }}-general-${{ hashFiles('**/build.sbt') }}
171+
restore-keys: ${{ runner.os }}-general-
172+
173+
- name: Test
174+
run: sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test;sjsJUnitTests/test"
175+
99176
community_build:
100-
runs-on: [self-hosted, linux]
177+
runs-on: [self-hosted, Linux]
101178
container: lampepfl/dotty:2020-04-24
102179

103180
steps:
@@ -138,7 +215,7 @@ jobs:
138215
./project/scripts/sbt community-build/test
139216
140217
test_sbt:
141-
runs-on: [self-hosted, linux]
218+
runs-on: [self-hosted, Linux]
142219
container: lampepfl/dotty:2020-04-24
143220
if: (
144221
github.event_name == 'push' &&
@@ -181,7 +258,7 @@ jobs:
181258
run: ./project/scripts/sbt sbt-dotty/scripted
182259

183260
test_java8:
184-
runs-on: [self-hosted, linux]
261+
runs-on: [self-hosted, Linux]
185262
container: lampepfl/dotty:2020-04-24
186263
if: (
187264
github.event_name == 'push' &&
@@ -227,7 +304,7 @@ jobs:
227304
run: ./project/scripts/sbt ";compile ;test"
228305

229306
publish_nightly:
230-
runs-on: [self-hosted, linux]
307+
runs-on: [self-hosted, Linux]
231308
container: lampepfl/dotty:2020-04-24
232309
needs: [test, test_bootstrapped, community_build, test_sbt, test_java8]
233310
if: github.event_name == 'schedule'
@@ -274,7 +351,7 @@ jobs:
274351
./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease"
275352
276353
nightly_documentation:
277-
runs-on: [self-hosted, linux]
354+
runs-on: [self-hosted, Linux]
278355
container: lampepfl/dotty:2020-04-24
279356
needs: [publish_nightly]
280357
if: github.event_name == 'schedule'
@@ -328,7 +405,7 @@ jobs:
328405
publish_branch: gh-pages
329406

330407
publish_release:
331-
runs-on: [self-hosted, linux]
408+
runs-on: [self-hosted, Linux]
332409
container: lampepfl/dotty:2020-04-24
333410
needs: [test, test_bootstrapped, community_build, test_sbt, test_java8]
334411
if: github.event_name == 'push' &&
@@ -423,7 +500,7 @@ jobs:
423500
asset_content_type: text/plain
424501

425502
release_documentation:
426-
runs-on: [self-hosted, linux]
503+
runs-on: [self-hosted, Linux]
427504
container: lampepfl/dotty:2020-04-24
428505
needs: [publish_release]
429506
if: github.event_name == 'push' &&
@@ -480,7 +557,7 @@ jobs:
480557
publish_branch: gh-pages
481558

482559
publish_sbt_release:
483-
runs-on: [self-hosted, linux]
560+
runs-on: [self-hosted, Linux]
484561
container: lampepfl/dotty:2020-04-24
485562
needs: [test, test_bootstrapped, community_build, test_sbt, test_java8]
486563
if: github.event_name == 'push' &&

project/Dockerfile

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# FROM mcr.microsoft.com/windows/nanoserver:1903
2+
FROM mcr.microsoft.com/powershell:lts-nanoserver-2004
3+
4+
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
5+
6+
# Fix coursier bug on windows
7+
# java.lang.RuntimeException: java.io.IOException: Cannot run program "powershell.exe": CreateProcess error=2, The system cannot find the file specified
8+
# at lmcoursier.internal.shaded.coursier.cache.shaded.io.github.soc.directories.Util.runCommands(Util.java:189)
9+
# at lmcoursier.internal.shaded.coursier.cache.shaded.io.github.soc.directories.Util.getWinDirs(Util.java:150)
10+
RUN cp 'C:\Program Files\PowerShell\pwsh.exe' 'C:\Program Files\PowerShell\powershell.exe'
11+
12+
ENV JAVA_HOME C:\\openjdk-11
13+
# "ERROR: Access to the registry path is denied."
14+
USER ContainerAdministrator
15+
16+
# https://adoptopenjdk.net/upstream.html
17+
# >
18+
# > What are these binaries?
19+
# >
20+
# > These binaries are built by Red Hat on their infrastructure on behalf of the OpenJDK jdk8u and jdk11u projects. The binaries are created from the unmodified source code at OpenJDK. Although no formal support agreement is provided, please report any bugs you may find to https://bugs.java.com/.
21+
# >
22+
ENV JAVA_VERSION 11.0.8
23+
# https://github.com/docker-library/openjdk/issues/320#issuecomment-494050246
24+
# >
25+
# > I am the OpenJDK 8 and 11 Updates OpenJDK project lead.
26+
# > ...
27+
# > While it is true that the OpenJDK Governing Board has not sanctioned those releases, they (or rather we, since I am a member) didn't sanction Oracle's OpenJDK releases either. As far as I am aware, the lead of an OpenJDK project is entitled to release binary builds, and there is clearly a need for them.
28+
# >
29+
30+
COPY --from=openjdk:11.0.8-jdk-windowsservercore-1809 $JAVA_HOME $JAVA_HOME
31+
32+
RUN Write-host Updating PATH ...
33+
RUN [Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\openjdk-11\bin', 'Machine')
34+
RUN Write-host Updated: $env:path
35+
36+
# SBT
37+
ENV SBT_DOWNLOAD_URL https://github.com/sbt/sbt/releases/download/v1.3.4/sbt-1.3.4.zip
38+
RUN Invoke-WebRequest -Uri $env:SBT_DOWNLOAD_URL -OutFile sbt-1.3.4.zip
39+
RUN Expand-Archive sbt-1.3.4.zip -DestinationPath "C:\\"
40+
RUN Remove-Item sbt-1.3.4.zip
41+
RUN Write-host Updating PATH ...
42+
RUN [Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\sbt\bin', 'Machine')
43+
RUN Write-host Updated: $env:path
44+
45+
# Git
46+
ENV GIT_VERSION 2.28.0
47+
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/MinGit-${GIT_VERSION}-64-bit.zip
48+
RUN Invoke-WebRequest -UseBasicParsing $env:GIT_DOWNLOAD_URL -OutFile git.zip
49+
RUN Expand-Archive git.zip -DestinationPath C:\git
50+
RUN Remove-Item git.zip
51+
RUN Write-host Updating PATH ...
52+
RUN [Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin', 'Machine')
53+
RUN Write-host Updated: $env:path
54+
55+
USER ContainerUser
56+
57+
RUN Write-host Verifying install ...
58+
RUN Write-host javac --version && javac --version
59+
RUN Write-host java --version && java --version
60+
RUN Write-host sbt sbtVersion && sbt sbtVersion
61+
RUN Write-host git --version && git --version

0 commit comments

Comments
 (0)