Skip to content

Commit bbf8c3e

Browse files
committed
Add support for windows-2025 runner images (#65)
1 parent 10b7b9a commit bbf8c3e

File tree

3 files changed

+53
-13
lines changed

3 files changed

+53
-13
lines changed

.github/workflows/test.main.kts

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import kotlin.math.min
5656
val environments = listOf(
5757
"windows-2019",
5858
"windows-2022",
59+
"windows-2025",
5960
"windows-latest"
6061
)
6162

.github/workflows/test.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ jobs:
8686
environment:
8787
- 'windows-2019'
8888
- 'windows-2022'
89+
- 'windows-2025'
8990
- 'windows-latest'
9091
distribution:
9192
- user-id: 'invalid'
@@ -127,6 +128,7 @@ jobs:
127128
environment:
128129
- 'windows-2019'
129130
- 'windows-2022'
131+
- 'windows-2025'
130132
- 'windows-latest'
131133
wsl-version:
132134
- '-1'
@@ -167,6 +169,7 @@ jobs:
167169
environment:
168170
- 'windows-2019'
169171
- 'windows-2022'
172+
- 'windows-2025'
170173
- 'windows-latest'
171174
distribution:
172175
- wsl-id: 'Debian'
@@ -372,6 +375,7 @@ jobs:
372375
environment:
373376
- 'windows-2019'
374377
- 'windows-2022'
378+
- 'windows-2025'
375379
- 'windows-latest'
376380
distribution:
377381
- wsl-id: 'Debian'
@@ -936,6 +940,7 @@ jobs:
936940
environment:
937941
- 'windows-2019'
938942
- 'windows-2022'
943+
- 'windows-2025'
939944
- 'windows-latest'
940945
distribution:
941946
- wsl-id: 'Debian'
@@ -1045,6 +1050,7 @@ jobs:
10451050
environment:
10461051
- 'windows-2019'
10471052
- 'windows-2022'
1053+
- 'windows-2025'
10481054
- 'windows-latest'
10491055
distribution:
10501056
- wsl-id: 'Debian'
@@ -1190,6 +1196,7 @@ jobs:
11901196
environment:
11911197
- 'windows-2019'
11921198
- 'windows-2022'
1199+
- 'windows-2025'
11931200
- 'windows-latest'
11941201
distribution:
11951202
- wsl-id: 'Debian'
@@ -1326,6 +1333,7 @@ jobs:
13261333
matrix:
13271334
environment:
13281335
- 'windows-2022'
1336+
- 'windows-2025'
13291337
- 'windows-latest'
13301338
distribution:
13311339
- wsl-id: 'Debian'
@@ -1407,6 +1415,7 @@ jobs:
14071415
matrix:
14081416
environment:
14091417
- 'windows-2022'
1418+
- 'windows-2025'
14101419
- 'windows-latest'
14111420
steps:
14121421
- id: 'step-0'
@@ -1457,6 +1466,7 @@ jobs:
14571466
environment:
14581467
- 'windows-2019'
14591468
- 'windows-2022'
1469+
- 'windows-2025'
14601470
- 'windows-latest'
14611471
distribution:
14621472
- wsl-id: 'Debian'
@@ -1538,6 +1548,7 @@ jobs:
15381548
environment:
15391549
- 'windows-2019'
15401550
- 'windows-2022'
1551+
- 'windows-2025'
15411552
- 'windows-latest'
15421553
distributions:
15431554
- distribution1:
@@ -1694,6 +1705,7 @@ jobs:
16941705
environment:
16951706
- 'windows-2019'
16961707
- 'windows-2022'
1708+
- 'windows-2025'
16971709
- 'windows-latest'
16981710
distribution:
16991711
- wsl-id: 'Debian'
@@ -1760,6 +1772,17 @@ jobs:
17601772
user-id: 'Debian'
17611773
match-pattern: '*Debian*'
17621774
default-absent-tool: 'dos2unix'
1775+
- environment: 'windows-2025'
1776+
distribution:
1777+
wsl-id: 'Debian'
1778+
user-id: 'Debian'
1779+
match-pattern: '*Debian*'
1780+
default-absent-tool: 'dos2unix'
1781+
distribution2:
1782+
wsl-id: 'Debian'
1783+
user-id: 'Debian'
1784+
match-pattern: '*Debian*'
1785+
default-absent-tool: 'dos2unix'
17631786
- environment: 'windows-latest'
17641787
distribution:
17651788
wsl-id: 'Debian'
@@ -1794,6 +1817,17 @@ jobs:
17941817
user-id: 'Ubuntu-20.04'
17951818
match-pattern: '*Ubuntu*20.04*'
17961819
default-absent-tool: 'dos2unix'
1820+
- environment: 'windows-2025'
1821+
distribution:
1822+
wsl-id: 'Debian'
1823+
user-id: 'Debian'
1824+
match-pattern: '*Debian*'
1825+
default-absent-tool: 'dos2unix'
1826+
distribution2:
1827+
wsl-id: 'Ubuntu'
1828+
user-id: 'Ubuntu-20.04'
1829+
match-pattern: '*Ubuntu*20.04*'
1830+
default-absent-tool: 'dos2unix'
17971831
- environment: 'windows-latest'
17981832
distribution:
17991833
wsl-id: 'Debian'
@@ -1981,6 +2015,7 @@ jobs:
19812015
environment:
19822016
- 'windows-2019'
19832017
- 'windows-2022'
2018+
- 'windows-2025'
19842019
- 'windows-latest'
19852020
distributions:
19862021
- incompatibleUbuntu: 'Ubuntu-22.04'

src/jsMain/kotlin/net/kautler/github/action/setup_wsl/SetupWsl.kt

+17-13
Original file line numberDiff line numberDiff line change
@@ -371,23 +371,27 @@ suspend fun verifyWindowsEnvironment() {
371371
}
372372

373373
suspend fun installDistribution() {
374+
// on windows-2025 WSL is not installed at all currently, so try to do a `wsl --update`
375+
// whenever `--update` is available which will also install WSL first if necessary
376+
// without installing a default distribution
377+
// work-around for https://github.com/actions/runner-images/issues/11265
378+
retry(10) {
379+
executeWslCommand(
380+
wslArguments = arrayOf("--update")
381+
)
382+
}
383+
384+
(2..30)
385+
.asFlow()
386+
.onEach { delay(1.seconds) }
387+
.onStart { emit(1) }
388+
.map { wslStatus() }
389+
.firstOrNull { !it.contains("WSL is finishing an upgrade...") }
390+
374391
executeWslCommand(
375392
wslArguments = arrayOf("--set-default-version", "${wslVersion()}")
376393
)
377-
if (wslVersion() != 1u) {
378-
retry(5) {
379-
executeWslCommand(
380-
wslArguments = arrayOf("--update")
381-
)
382-
}
383394

384-
(2..30)
385-
.asFlow()
386-
.onEach { delay(1.seconds) }
387-
.onStart { emit(1) }
388-
.map { wslStatus() }
389-
.firstOrNull { !it.contains("WSL is finishing an upgrade...") }
390-
}
391395
exec(
392396
commandLine = """"${path.join(distributionDirectory(), distribution.installerFile)}"""",
393397
args = arrayOf("install", "--root"),

0 commit comments

Comments
 (0)