Skip to content

Commit d4e8379

Browse files
committed
[Gradle Release Plugin] - pre tag commit: 'v3.0.0'.
2 parents c5a800f + f482fac commit d4e8379

File tree

7 files changed

+62
-107
lines changed

7 files changed

+62
-107
lines changed

.github/workflows/test.main.kts

+20-20
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import it.krzeminski.githubactions.domain.triggers.Schedule
4141
import it.krzeminski.githubactions.dsl.JobBuilder
4242
import it.krzeminski.githubactions.dsl.WorkflowBuilder
4343
import it.krzeminski.githubactions.dsl.expressions.expr
44+
import kotlin.math.min
4445

4546
val environments = listOf(
4647
"windows-2019",
@@ -106,7 +107,8 @@ val ubuntu1604 = mapOf(
106107

107108
val distributions = listOf(
108109
debian,
109-
alpine,
110+
// disable testing on Alpine for the time being due to https://github.com/Vampire/setup-wsl/issues/50
111+
//alpine,
110112
kali,
111113
openSuseLeap15_2,
112114
ubuntu2204,
@@ -834,20 +836,20 @@ workflowWithCopyright(
834836
executeActionStep = localExecuteActionStep
835837
verifyInstalledDistribution(
836838
name = "Test - wsl-bash_${expr("matrix.distributions.distribution$i.user-id")} should use the correct distribution",
837-
conditionTransformer = if (i == 5) {
838-
{ executeActionStep.successNotOnUbuntu2004Condition }
839+
conditionTransformer = if (distributions[i] == ubuntu2004) {
840+
{ executeActionStep.getSuccessNotOnUbuntu2004Condition(i) }
839841
} else {
840842
{ it }
841843
},
842-
// the formula adds 1 to the indices after 5
843-
// to mitigate the double entry for index 5
844-
shell = Shell.Custom("wsl-bash_${distributions[(i / 6) + i - 1]["user-id"]} {0}"),
844+
// the formula adds 1 to the indices from ubuntu2004 on
845+
// to mitigate the double entry for the previous index
846+
shell = Shell.Custom("wsl-bash_${distributions[min(1, i / (distributions.indexOf(ubuntu2004) + 1)) + i - 1]["user-id"]} {0}"),
845847
expectedPatternExpression = "matrix.distributions.distribution$i.match-pattern"
846848
)
847-
if (i == 5) {
849+
if (distributions[i] == ubuntu2004) {
848850
verifyInstalledDistribution(
849851
name = "Test - wsl-bash_${expr("matrix.distributions.distribution$i.user-id")} should use the correct distribution",
850-
conditionTransformer = { executeActionStep.successNotOnUbuntu2204Condition },
852+
conditionTransformer = { executeActionStep.getSuccessNotOnUbuntu2204Condition(i) },
851853
shell = Shell.Custom("wsl-bash_${distributions[i]["user-id"]} {0}"),
852854
expectedPatternExpression = "matrix.distributions.distribution$i.match-pattern"
853855
)
@@ -1055,18 +1057,16 @@ val Step.successOnAlpineCondition
10551057
&& (matrix.distribution.user-id == 'Alpine')
10561058
""".trimIndent()
10571059

1058-
val Step.successNotOnUbuntu2004Condition
1059-
get() = """
1060-
always()
1061-
&& ($outcome == 'success')
1062-
&& (matrix.distributions.distribution5.user-id != 'Ubuntu-20.04')
1063-
""".trimIndent()
1060+
fun Step.getSuccessNotOnUbuntu2004Condition(i: Int) = """
1061+
always()
1062+
&& ($outcome == 'success')
1063+
&& (matrix.distributions.distribution$i.user-id != 'Ubuntu-20.04')
1064+
""".trimIndent()
10641065

1065-
val Step.successNotOnUbuntu2204Condition
1066-
get() = """
1067-
always()
1068-
&& ($outcome == 'success')
1069-
&& (matrix.distributions.distribution5.user-id != 'Ubuntu-22.04')
1070-
""".trimIndent()
1066+
fun Step.getSuccessNotOnUbuntu2204Condition(i: Int) = """
1067+
always()
1068+
&& ($outcome == 'success')
1069+
&& (matrix.distributions.distribution$i.user-id != 'Ubuntu-22.04')
1070+
""".trimIndent()
10711071

10721072
val Step.outcome get() = "steps.$id.outcome"

.github/workflows/test.yaml

+25-70
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,6 @@ jobs:
336336
user-id: Debian
337337
match-pattern: '*Debian*'
338338
default-absent-tool: dos2unix
339-
- wsl-id: Alpine
340-
user-id: Alpine
341-
match-pattern: '*Alpine*'
342-
default-absent-tool: dos2unix
343339
- wsl-id: kali-linux
344340
user-id: kali-linux
345341
match-pattern: '*Kali*'
@@ -828,10 +824,6 @@ jobs:
828824
user-id: Debian
829825
match-pattern: '*Debian*'
830826
default-absent-tool: dos2unix
831-
- wsl-id: Alpine
832-
user-id: Alpine
833-
match-pattern: '*Alpine*'
834-
default-absent-tool: dos2unix
835827
- wsl-id: kali-linux
836828
user-id: kali-linux
837829
match-pattern: '*Kali*'
@@ -928,10 +920,6 @@ jobs:
928920
user-id: Debian
929921
match-pattern: '*Debian*'
930922
default-absent-tool: dos2unix
931-
- wsl-id: Alpine
932-
user-id: Alpine
933-
match-pattern: '*Alpine*'
934-
default-absent-tool: dos2unix
935923
- wsl-id: kali-linux
936924
user-id: kali-linux
937925
match-pattern: '*Kali*'
@@ -1061,10 +1049,6 @@ jobs:
10611049
user-id: Debian
10621050
match-pattern: '*Debian*'
10631051
default-absent-tool: dos2unix
1064-
- wsl-id: Alpine
1065-
user-id: Alpine
1066-
match-pattern: '*Alpine*'
1067-
default-absent-tool: dos2unix
10681052
- wsl-id: kali-linux
10691053
user-id: kali-linux
10701054
match-pattern: '*Kali*'
@@ -1290,10 +1274,6 @@ jobs:
12901274
user-id: Debian
12911275
match-pattern: '*Debian*'
12921276
default-absent-tool: dos2unix
1293-
- wsl-id: Alpine
1294-
user-id: Alpine
1295-
match-pattern: '*Alpine*'
1296-
default-absent-tool: dos2unix
12971277
- wsl-id: kali-linux
12981278
user-id: kali-linux
12991279
match-pattern: '*Kali*'
@@ -1499,31 +1479,26 @@ jobs:
14991479
match-pattern: '*Debian*'
15001480
default-absent-tool: dos2unix
15011481
distribution2:
1502-
wsl-id: Alpine
1503-
user-id: Alpine
1504-
match-pattern: '*Alpine*'
1505-
default-absent-tool: dos2unix
1506-
distribution3:
15071482
wsl-id: kali-linux
15081483
user-id: kali-linux
15091484
match-pattern: '*Kali*'
15101485
default-absent-tool: dos2unix
1511-
distribution4:
1486+
distribution3:
15121487
wsl-id: openSUSE-Leap-15.2
15131488
user-id: openSUSE-Leap-15.2
15141489
match-pattern: '*openSUSE*Leap*15.2*'
15151490
default-absent-tool: which
1516-
distribution5:
1491+
distribution4:
15171492
wsl-id: Ubuntu
15181493
user-id: Ubuntu-20.04
15191494
match-pattern: '*Ubuntu*20.04*'
15201495
default-absent-tool: dos2unix
1521-
distribution6:
1496+
distribution5:
15221497
wsl-id: Ubuntu-18.04
15231498
user-id: Ubuntu-18.04
15241499
match-pattern: '*Ubuntu*18.04*'
15251500
default-absent-tool: dos2unix
1526-
distribution7:
1501+
distribution6:
15271502
wsl-id: Ubuntu-16.04
15281503
user-id: Ubuntu-16.04
15291504
match-pattern: '*Ubuntu*16.04*'
@@ -1534,31 +1509,26 @@ jobs:
15341509
match-pattern: '*Debian*'
15351510
default-absent-tool: dos2unix
15361511
distribution2:
1537-
wsl-id: Alpine
1538-
user-id: Alpine
1539-
match-pattern: '*Alpine*'
1540-
default-absent-tool: dos2unix
1541-
distribution3:
15421512
wsl-id: kali-linux
15431513
user-id: kali-linux
15441514
match-pattern: '*Kali*'
15451515
default-absent-tool: dos2unix
1546-
distribution4:
1516+
distribution3:
15471517
wsl-id: openSUSE-Leap-15.2
15481518
user-id: openSUSE-Leap-15.2
15491519
match-pattern: '*openSUSE*Leap*15.2*'
15501520
default-absent-tool: which
1551-
distribution5:
1521+
distribution4:
15521522
wsl-id: Ubuntu
15531523
user-id: Ubuntu-22.04
15541524
match-pattern: '*Ubuntu*22.04*'
15551525
default-absent-tool: dos2unix
1556-
distribution6:
1526+
distribution5:
15571527
wsl-id: Ubuntu-18.04
15581528
user-id: Ubuntu-18.04
15591529
match-pattern: '*Ubuntu*18.04*'
15601530
default-absent-tool: dos2unix
1561-
distribution7:
1531+
distribution6:
15621532
wsl-id: Ubuntu-16.04
15631533
user-id: Ubuntu-16.04
15641534
match-pattern: '*Ubuntu*16.04*'
@@ -1609,12 +1579,6 @@ jobs:
16091579
distribution: ${{ matrix.distributions.distribution6.user-id }}
16101580
set-as-default: false
16111581
- id: step-7
1612-
name: Execute action for ${{ matrix.distributions.distribution7.user-id }}
1613-
uses: ./
1614-
with:
1615-
distribution: ${{ matrix.distributions.distribution7.user-id }}
1616-
set-as-default: false
1617-
- id: step-8
16181582
name: Test - wsl-bash_${{ matrix.distributions.distribution1.user-id }} should use the correct distribution
16191583
shell: wsl-bash_Debian {0}
16201584
run: |-
@@ -1623,68 +1587,59 @@ jobs:
16231587
if: |-
16241588
always()
16251589
&& (steps.step-1.outcome == 'success')
1626-
- id: step-9
1590+
- id: step-8
16271591
name: Test - wsl-bash_${{ matrix.distributions.distribution2.user-id }} should use the correct distribution
1628-
shell: wsl-bash_Alpine {0}
1592+
shell: wsl-bash_kali-linux {0}
16291593
run: |-
16301594
cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true)
16311595
[[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true))" == ${{ matrix.distributions.distribution2.match-pattern }} ]]
16321596
if: |-
16331597
always()
16341598
&& (steps.step-2.outcome == 'success')
1635-
- id: step-10
1599+
- id: step-9
16361600
name: Test - wsl-bash_${{ matrix.distributions.distribution3.user-id }} should use the correct distribution
1637-
shell: wsl-bash_kali-linux {0}
1601+
shell: wsl-bash_openSUSE-Leap-15.2 {0}
16381602
run: |-
16391603
cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true)
16401604
[[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true))" == ${{ matrix.distributions.distribution3.match-pattern }} ]]
16411605
if: |-
16421606
always()
16431607
&& (steps.step-3.outcome == 'success')
1644-
- id: step-11
1608+
- id: step-10
16451609
name: Test - wsl-bash_${{ matrix.distributions.distribution4.user-id }} should use the correct distribution
1646-
shell: wsl-bash_openSUSE-Leap-15.2 {0}
1610+
shell: wsl-bash_Ubuntu-22.04 {0}
16471611
run: |-
16481612
cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true)
16491613
[[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true))" == ${{ matrix.distributions.distribution4.match-pattern }} ]]
16501614
if: |-
16511615
always()
16521616
&& (steps.step-4.outcome == 'success')
1653-
- id: step-12
1654-
name: Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution
1655-
shell: wsl-bash_Ubuntu-22.04 {0}
1617+
&& (matrix.distributions.distribution4.user-id != 'Ubuntu-20.04')
1618+
- id: step-11
1619+
name: Test - wsl-bash_${{ matrix.distributions.distribution4.user-id }} should use the correct distribution
1620+
shell: wsl-bash_Ubuntu-20.04 {0}
16561621
run: |-
16571622
cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true)
1658-
[[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true))" == ${{ matrix.distributions.distribution5.match-pattern }} ]]
1623+
[[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true))" == ${{ matrix.distributions.distribution4.match-pattern }} ]]
16591624
if: |-
16601625
always()
1661-
&& (steps.step-5.outcome == 'success')
1662-
&& (matrix.distributions.distribution5.user-id != 'Ubuntu-20.04')
1663-
- id: step-13
1626+
&& (steps.step-4.outcome == 'success')
1627+
&& (matrix.distributions.distribution4.user-id != 'Ubuntu-22.04')
1628+
- id: step-12
16641629
name: Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution
1665-
shell: wsl-bash_Ubuntu-20.04 {0}
1630+
shell: wsl-bash_Ubuntu-18.04 {0}
16661631
run: |-
16671632
cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true)
16681633
[[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true))" == ${{ matrix.distributions.distribution5.match-pattern }} ]]
16691634
if: |-
16701635
always()
16711636
&& (steps.step-5.outcome == 'success')
1672-
&& (matrix.distributions.distribution5.user-id != 'Ubuntu-22.04')
1673-
- id: step-14
1637+
- id: step-13
16741638
name: Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should use the correct distribution
1675-
shell: wsl-bash_Ubuntu-18.04 {0}
1639+
shell: wsl-bash_Ubuntu-16.04 {0}
16761640
run: |-
16771641
cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true)
16781642
[[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true))" == ${{ matrix.distributions.distribution6.match-pattern }} ]]
16791643
if: |-
16801644
always()
16811645
&& (steps.step-6.outcome == 'success')
1682-
- id: step-15
1683-
name: Test - wsl-bash_${{ matrix.distributions.distribution7.user-id }} should use the correct distribution
1684-
shell: wsl-bash_Ubuntu-16.04 {0}
1685-
run: |-
1686-
cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true)
1687-
[[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -or -name 'issue*' \) -exec cat {} + || true) <([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true) <([ -f /proc/version ] && cat /proc/version || true))" == ${{ matrix.distributions.distribution7.match-pattern }} ]]
1688-
if: |-
1689-
always()
1690-
&& (steps.step-7.outcome == 'success')

0 commit comments

Comments
 (0)