23
23
@file:DependsOn(" actions:checkout:v4" )
24
24
@file:DependsOn(" actions:setup-java:v4" )
25
25
@file:DependsOn(" burrunan:gradle-cache-action:v1" )
26
- @file:DependsOn(" Vampire:setup-wsl:v3 " )
26
+ @file:DependsOn(" Vampire:setup-wsl:RELEASE " )
27
27
28
28
import io.github.typesafegithub.workflows.actions.actions.CacheRestore
29
29
import io.github.typesafegithub.workflows.actions.actions.CacheSave
@@ -157,9 +157,7 @@ workflowWithCopyright(
157
157
158
158
val executeAction = SetupWsl (
159
159
distribution = SetupWsl .Distribution .Custom (expr(" matrix.distribution.user-id" )),
160
- _customInputs = mapOf (
161
- " wsl-version" to " 1"
162
- )
160
+ wslVersion = 1
163
161
)
164
162
165
163
val build = job(
@@ -289,9 +287,8 @@ workflowWithCopyright(
289
287
executeActionStep = usesSelf(
290
288
action = executeAction.copy(
291
289
distribution = Debian ,
292
- _customInputs = mapOf (
293
- " wsl-version" to expr(" matrix.wsl-version" )
294
- )
290
+ wslVersion = null ,
291
+ wslVersion_Untyped = expr(" matrix.wsl-version" )
295
292
),
296
293
continueOnError = true
297
294
)
@@ -318,9 +315,7 @@ workflowWithCopyright(
318
315
executeActionStep = usesSelf(
319
316
action = SetupWsl (
320
317
update = true ,
321
- _customInputs = mapOf (
322
- " wsl-version" to " 1"
323
- )
318
+ wslVersion = 1
324
319
)
325
320
)
326
321
commonTests()
@@ -362,10 +357,9 @@ workflowWithCopyright(
362
357
executeActionStep = usesSelf(
363
358
action = executeAction.copy(
364
359
useCache = false ,
365
- _customInputs = mapOf (
366
- // part of work-around for https://bugs.kali.org/view.php?id=8921
367
- " wsl-version" to expr(getWslVersionExpression(kali))
368
- )
360
+ // part of work-around for https://bugs.kali.org/view.php?id=8921
361
+ wslVersion = null ,
362
+ wslVersion_Untyped = expr(getWslVersionExpression(kali))
369
363
)
370
364
)
371
365
verifyFailure(
@@ -381,7 +375,7 @@ workflowWithCopyright(
381
375
name = " Install Bash on Alpine" ,
382
376
action = executeAction.copy(
383
377
additionalPackages = listOf (" bash" ),
384
- _customInputs = emptyMap()
378
+ wslVersion = null
385
379
),
386
380
condition = executeActionStep.getSuccessOnDistributionCondition(alpine)
387
381
)
@@ -407,7 +401,7 @@ workflowWithCopyright(
407
401
name = " Add wsl-sh wrapper" ,
408
402
action = executeAction.copy(
409
403
wslShellCommand = " sh -eu" ,
410
- _customInputs = emptyMap()
404
+ wslVersion = null
411
405
)
412
406
)
413
407
runAfterSuccess(
@@ -442,7 +436,7 @@ workflowWithCopyright(
442
436
executeActionStep = usesSelfAfterSuccess(
443
437
name = " Re-add wsl-bash wrapper" ,
444
438
action = executeAction.copy(
445
- _customInputs = emptyMap()
439
+ wslVersion = null
446
440
)
447
441
)
448
442
runAfterSuccess(
@@ -485,7 +479,7 @@ workflowWithCopyright(
485
479
action = executeAction.copy(
486
480
additionalPackages = listOf (" sudo" ),
487
481
wslShellCommand = """ bash -c "sudo -u test bash --noprofile --norc -euo pipefail "\""" ,
488
- _customInputs = emptyMap()
482
+ wslVersion = null
489
483
)
490
484
)
491
485
verifyCommandResult(
@@ -529,7 +523,7 @@ workflowWithCopyright(
529
523
},
530
524
action = executeAction.copy(
531
525
wslShellCommand = """ bash -c "sudo -u test bash --noprofile --norc -euo pipefail '{0}'"""" ,
532
- _customInputs = emptyMap()
526
+ wslVersion = null
533
527
)
534
528
)
535
529
verifyCommandResult(
@@ -541,7 +535,7 @@ workflowWithCopyright(
541
535
executeActionStep = usesSelfAfterSuccess(
542
536
name = " Set wsl-bash wrapper to use default user by default" ,
543
537
action = executeAction.copy(
544
- _customInputs = emptyMap()
538
+ wslVersion = null
545
539
)
546
540
)
547
541
verifyCommandResult(
@@ -558,7 +552,7 @@ workflowWithCopyright(
558
552
name = " Set wsl-bash wrapper to use existing user test by default with extra parameter" ,
559
553
action = executeAction.copy(
560
554
wslShellUser = " test" ,
561
- _customInputs = emptyMap()
555
+ wslVersion = null
562
556
)
563
557
)
564
558
verifyCommandResult(
@@ -575,7 +569,7 @@ workflowWithCopyright(
575
569
name = " Set wsl-bash wrapper to use non-existing user test2 by default with extra parameter" ,
576
570
action = executeAction.copy(
577
571
wslShellUser = " test2" ,
578
- _customInputs = emptyMap()
572
+ wslVersion = null
579
573
)
580
574
)
581
575
verifyCommandResult(
@@ -598,7 +592,7 @@ workflowWithCopyright(
598
592
executeActionStep = usesSelfAfterSuccess(
599
593
name = " Make a no-op execution of the action" ,
600
594
action = executeAction.copy(
601
- _customInputs = emptyMap()
595
+ wslVersion = null
602
596
)
603
597
)
604
598
verifyCommandResult(
@@ -634,7 +628,7 @@ workflowWithCopyright(
634
628
name = " Install Bash on Alpine" ,
635
629
action = executeAction.copy(
636
630
additionalPackages = listOf (" bash" ),
637
- _customInputs = emptyMap()
631
+ wslVersion = null
638
632
),
639
633
condition = executeActionStep.getSuccessOnDistributionCondition(alpine)
640
634
)
@@ -675,7 +669,7 @@ workflowWithCopyright(
675
669
name = " Install Bash on Alpine" ,
676
670
action = executeAction.copy(
677
671
additionalPackages = listOf (" bash" ),
678
- _customInputs = emptyMap()
672
+ wslVersion = null
679
673
),
680
674
condition = executeActionStep.getSuccessOnDistributionCondition(alpine)
681
675
)
@@ -704,7 +698,7 @@ workflowWithCopyright(
704
698
[automount]
705
699
root = /
706
700
""" .trimIndent(),
707
- _customInputs = emptyMap()
701
+ wslVersion = null
708
702
)
709
703
)
710
704
runAfterSuccess(
@@ -742,10 +736,9 @@ workflowWithCopyright(
742
736
expr(" matrix.distribution.default-absent-tool" ),
743
737
" bash"
744
738
),
745
- _customInputs = mapOf (
746
- // part of work-around for https://bugs.kali.org/view.php?id=8921
747
- " wsl-version" to expr(getWslVersionExpression(kali))
748
- )
739
+ // part of work-around for https://bugs.kali.org/view.php?id=8921
740
+ wslVersion = null ,
741
+ wslVersion_Untyped = expr(getWslVersionExpression(kali))
749
742
),
750
743
// part of work-around for https://bugs.kali.org/view.php?id=8921
751
744
condition = """
@@ -824,9 +817,8 @@ workflowWithCopyright(
824
817
""" .trimIndent()
825
818
)
826
819
),
827
- _customInputs = mapOf (
828
- " wsl-version" to expr(" matrix.wsl-version" )
829
- )
820
+ wslVersion = null ,
821
+ wslVersion_Untyped = expr(" matrix.wsl-version" )
830
822
)
831
823
)
832
824
verifyCommandResult(
@@ -855,25 +847,19 @@ workflowWithCopyright(
855
847
usesSelf(
856
848
action = executeAction.copy(
857
849
distribution = Debian ,
858
- _customInputs = mapOf (
859
- " wsl-version" to " 1"
860
- )
850
+ wslVersion = 1
861
851
)
862
852
)
863
853
usesSelf(
864
854
action = executeAction.copy(
865
855
distribution = Ubuntu1604 ,
866
- _customInputs = mapOf (
867
- " wsl-version" to " 2"
868
- )
856
+ wslVersion = 2
869
857
)
870
858
)
871
859
executeActionStep = usesSelf(
872
860
action = executeAction.copy(
873
861
distribution = Ubuntu1804 ,
874
- _customInputs = mapOf (
875
- " wsl-version" to " 1"
876
- )
862
+ wslVersion = 1
877
863
)
878
864
)
879
865
verifyCommandResult(
@@ -912,7 +898,7 @@ workflowWithCopyright(
912
898
""" .trimIndent()
913
899
)
914
900
),
915
- _customInputs = emptyMap()
901
+ wslVersion = null
916
902
)
917
903
)
918
904
verifyCommandResult(
@@ -992,28 +978,22 @@ workflowWithCopyright(
992
978
name = " Execute action for ${expr(" matrix.distributions.distribution1.user-id" )} " ,
993
979
action = SetupWsl (
994
980
distribution = SetupWsl .Distribution .Custom (expr(" matrix.distributions.distribution1.user-id" )),
995
- _customInputs = mapOf (
996
- " wsl-version" to " 1"
997
- )
981
+ wslVersion = 1
998
982
)
999
983
)
1000
984
usesSelf(
1001
985
name = " Execute action for ${expr(" matrix.distributions.distribution2.user-id" )} " ,
1002
986
action = SetupWsl (
1003
987
distribution = SetupWsl .Distribution .Custom (expr(" matrix.distributions.distribution2.user-id" )),
1004
- _customInputs = mapOf (
1005
- " wsl-version" to " 1"
1006
- )
988
+ wslVersion = 1
1007
989
)
1008
990
)
1009
991
usesSelf(
1010
992
name = " Execute action for ${expr(" matrix.distributions.distribution3.user-id" )} " ,
1011
993
action = SetupWsl (
1012
994
distribution = SetupWsl .Distribution .Custom (expr(" matrix.distributions.distribution3.user-id" )),
1013
995
setAsDefault = false ,
1014
- _customInputs = mapOf (
1015
- " wsl-version" to " 1"
1016
- )
996
+ wslVersion = 1
1017
997
)
1018
998
)
1019
999
executeActionStep = usesSelf(
@@ -1087,19 +1067,18 @@ workflowWithCopyright(
1087
1067
""" .trimMargin()
1088
1068
)
1089
1069
),
1090
- _customInputs = mapOf (
1091
- // part of work-around for https://bugs.kali.org/view.php?id=8921
1092
- // and https://bugs.kali.org/view.php?id=6672
1093
- // and https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2069555
1094
- " wsl-version" to expr(getWslVersionExpression(kali, ubuntu2404))
1095
- )
1070
+ // part of work-around for https://bugs.kali.org/view.php?id=8921
1071
+ // and https://bugs.kali.org/view.php?id=6672
1072
+ // and https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2069555
1073
+ wslVersion = null ,
1074
+ wslVersion_Untyped = expr(getWslVersionExpression(kali, ubuntu2404))
1096
1075
)
1097
1076
)
1098
1077
usesSelf(
1099
1078
name = " Update distribution" ,
1100
1079
action = executeAction.copy(
1101
1080
update = true ,
1102
- _customInputs = emptyMap()
1081
+ wslVersion = null
1103
1082
),
1104
1083
// part of work-around for https://bugs.kali.org/view.php?id=6672
1105
1084
// and https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2069555
@@ -1119,7 +1098,7 @@ workflowWithCopyright(
1119
1098
name = " Install default absent tool" ,
1120
1099
action = executeAction.copy(
1121
1100
additionalPackages = listOf (expr(" matrix.distribution.default-absent-tool" )),
1122
- _customInputs = emptyMap()
1101
+ wslVersion = null
1123
1102
),
1124
1103
// part of work-around for https://bugs.kali.org/view.php?id=8921
1125
1104
condition = """
@@ -1155,9 +1134,7 @@ workflowWithCopyright(
1155
1134
name = " Execute action for ${expr(" matrix.distribution2.user-id" )} " ,
1156
1135
action = SetupWsl (
1157
1136
distribution = SetupWsl .Distribution .Custom (expr(" matrix.distribution2.user-id" )),
1158
- _customInputs = mapOf (
1159
- " wsl-version" to " 1"
1160
- )
1137
+ wslVersion = 1
1161
1138
)
1162
1139
)
1163
1140
verifyInstalledDistribution(
@@ -1167,7 +1144,7 @@ workflowWithCopyright(
1167
1144
executeActionStep = usesSelfAfterSuccess(
1168
1145
name = " Re-execute action" ,
1169
1146
action = executeAction.copy(
1170
- _customInputs = emptyMap()
1147
+ wslVersion = null
1171
1148
)
1172
1149
)
1173
1150
verifyInstalledDistribution(
@@ -1178,7 +1155,7 @@ workflowWithCopyright(
1178
1155
name = " Set as default" ,
1179
1156
action = executeAction.copy(
1180
1157
setAsDefault = true ,
1181
- _customInputs = emptyMap()
1158
+ wslVersion = null
1182
1159
)
1183
1160
)
1184
1161
verifyInstalledDistribution(
@@ -1222,9 +1199,7 @@ workflowWithCopyright(
1222
1199
distribution = SetupWsl .Distribution .Custom (expr(" matrix.distributions.distribution$it .user-id" )),
1223
1200
additionalPackages = if (it == 2 ) listOf (" bash" ) else null ,
1224
1201
setAsDefault = if (it >= 3 ) false else null ,
1225
- _customInputs = mapOf (
1226
- " wsl-version" to " 1"
1227
- )
1202
+ wslVersion = 1
1228
1203
)
1229
1204
)
1230
1205
}
0 commit comments