Skip to content

Commit

Permalink
Disable testing on Alpine for the time being
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Feb 7, 2024
1 parent b820055 commit 7b8ba9b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 90 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/test.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import it.krzeminski.githubactions.domain.triggers.Schedule
import it.krzeminski.githubactions.dsl.JobBuilder
import it.krzeminski.githubactions.dsl.WorkflowBuilder
import it.krzeminski.githubactions.dsl.expressions.expr
import kotlin.math.min

val environments = listOf(
"windows-2019",
Expand Down Expand Up @@ -106,7 +107,8 @@ val ubuntu1604 = mapOf(

val distributions = listOf(
debian,
alpine,
// disable testing on Alpine for the time being due to https://github.com/Vampire/setup-wsl/issues/50
//alpine,
kali,
openSuseLeap15_2,
ubuntu2204,
Expand Down Expand Up @@ -834,20 +836,20 @@ workflowWithCopyright(
executeActionStep = localExecuteActionStep
verifyInstalledDistribution(
name = "Test - wsl-bash_${expr("matrix.distributions.distribution$i.user-id")} should use the correct distribution",
conditionTransformer = if (i == 5) {
{ executeActionStep.successNotOnUbuntu2004Condition }
conditionTransformer = if (distributions[i] == ubuntu2004) {
{ executeActionStep.getSuccessNotOnUbuntu2004Condition(i) }
} else {
{ it }
},
// the formula adds 1 to the indices after 5
// to mitigate the double entry for index 5
shell = Shell.Custom("wsl-bash_${distributions[(i / 6) + i - 1]["user-id"]} {0}"),
// the formula adds 1 to the indices from ubuntu2004 on
// to mitigate the double entry for the previous index
shell = Shell.Custom("wsl-bash_${distributions[min(1, i / (distributions.indexOf(ubuntu2004) + 1)) + i - 1]["user-id"]} {0}"),
expectedPatternExpression = "matrix.distributions.distribution$i.match-pattern"
)
if (i == 5) {
if (distributions[i] == ubuntu2004) {
verifyInstalledDistribution(
name = "Test - wsl-bash_${expr("matrix.distributions.distribution$i.user-id")} should use the correct distribution",
conditionTransformer = { executeActionStep.successNotOnUbuntu2204Condition },
conditionTransformer = { executeActionStep.getSuccessNotOnUbuntu2204Condition(i) },
shell = Shell.Custom("wsl-bash_${distributions[i]["user-id"]} {0}"),
expectedPatternExpression = "matrix.distributions.distribution$i.match-pattern"
)
Expand Down Expand Up @@ -1055,18 +1057,16 @@ val Step.successOnAlpineCondition
&& (matrix.distribution.user-id == 'Alpine')
""".trimIndent()

val Step.successNotOnUbuntu2004Condition
get() = """
always()
&& ($outcome == 'success')
&& (matrix.distributions.distribution5.user-id != 'Ubuntu-20.04')
""".trimIndent()
fun Step.getSuccessNotOnUbuntu2004Condition(i: Int) = """
always()
&& ($outcome == 'success')
&& (matrix.distributions.distribution$i.user-id != 'Ubuntu-20.04')
""".trimIndent()

val Step.successNotOnUbuntu2204Condition
get() = """
always()
&& ($outcome == 'success')
&& (matrix.distributions.distribution5.user-id != 'Ubuntu-22.04')
""".trimIndent()
fun Step.getSuccessNotOnUbuntu2204Condition(i: Int) = """
always()
&& ($outcome == 'success')
&& (matrix.distributions.distribution$i.user-id != 'Ubuntu-22.04')
""".trimIndent()

val Step.outcome get() = "steps.$id.outcome"
95 changes: 25 additions & 70 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,6 @@ jobs:
user-id: Debian
match-pattern: '*Debian*'
default-absent-tool: dos2unix
- wsl-id: Alpine
user-id: Alpine
match-pattern: '*Alpine*'
default-absent-tool: dos2unix
- wsl-id: kali-linux
user-id: kali-linux
match-pattern: '*Kali*'
Expand Down Expand Up @@ -828,10 +824,6 @@ jobs:
user-id: Debian
match-pattern: '*Debian*'
default-absent-tool: dos2unix
- wsl-id: Alpine
user-id: Alpine
match-pattern: '*Alpine*'
default-absent-tool: dos2unix
- wsl-id: kali-linux
user-id: kali-linux
match-pattern: '*Kali*'
Expand Down Expand Up @@ -928,10 +920,6 @@ jobs:
user-id: Debian
match-pattern: '*Debian*'
default-absent-tool: dos2unix
- wsl-id: Alpine
user-id: Alpine
match-pattern: '*Alpine*'
default-absent-tool: dos2unix
- wsl-id: kali-linux
user-id: kali-linux
match-pattern: '*Kali*'
Expand Down Expand Up @@ -1061,10 +1049,6 @@ jobs:
user-id: Debian
match-pattern: '*Debian*'
default-absent-tool: dos2unix
- wsl-id: Alpine
user-id: Alpine
match-pattern: '*Alpine*'
default-absent-tool: dos2unix
- wsl-id: kali-linux
user-id: kali-linux
match-pattern: '*Kali*'
Expand Down Expand Up @@ -1290,10 +1274,6 @@ jobs:
user-id: Debian
match-pattern: '*Debian*'
default-absent-tool: dos2unix
- wsl-id: Alpine
user-id: Alpine
match-pattern: '*Alpine*'
default-absent-tool: dos2unix
- wsl-id: kali-linux
user-id: kali-linux
match-pattern: '*Kali*'
Expand Down Expand Up @@ -1499,31 +1479,26 @@ jobs:
match-pattern: '*Debian*'
default-absent-tool: dos2unix
distribution2:
wsl-id: Alpine
user-id: Alpine
match-pattern: '*Alpine*'
default-absent-tool: dos2unix
distribution3:
wsl-id: kali-linux
user-id: kali-linux
match-pattern: '*Kali*'
default-absent-tool: dos2unix
distribution4:
distribution3:
wsl-id: openSUSE-Leap-15.2
user-id: openSUSE-Leap-15.2
match-pattern: '*openSUSE*Leap*15.2*'
default-absent-tool: which
distribution5:
distribution4:
wsl-id: Ubuntu
user-id: Ubuntu-20.04
match-pattern: '*Ubuntu*20.04*'
default-absent-tool: dos2unix
distribution6:
distribution5:
wsl-id: Ubuntu-18.04
user-id: Ubuntu-18.04
match-pattern: '*Ubuntu*18.04*'
default-absent-tool: dos2unix
distribution7:
distribution6:
wsl-id: Ubuntu-16.04
user-id: Ubuntu-16.04
match-pattern: '*Ubuntu*16.04*'
Expand All @@ -1534,31 +1509,26 @@ jobs:
match-pattern: '*Debian*'
default-absent-tool: dos2unix
distribution2:
wsl-id: Alpine
user-id: Alpine
match-pattern: '*Alpine*'
default-absent-tool: dos2unix
distribution3:
wsl-id: kali-linux
user-id: kali-linux
match-pattern: '*Kali*'
default-absent-tool: dos2unix
distribution4:
distribution3:
wsl-id: openSUSE-Leap-15.2
user-id: openSUSE-Leap-15.2
match-pattern: '*openSUSE*Leap*15.2*'
default-absent-tool: which
distribution5:
distribution4:
wsl-id: Ubuntu
user-id: Ubuntu-22.04
match-pattern: '*Ubuntu*22.04*'
default-absent-tool: dos2unix
distribution6:
distribution5:
wsl-id: Ubuntu-18.04
user-id: Ubuntu-18.04
match-pattern: '*Ubuntu*18.04*'
default-absent-tool: dos2unix
distribution7:
distribution6:
wsl-id: Ubuntu-16.04
user-id: Ubuntu-16.04
match-pattern: '*Ubuntu*16.04*'
Expand Down Expand Up @@ -1609,12 +1579,6 @@ jobs:
distribution: ${{ matrix.distributions.distribution6.user-id }}
set-as-default: false
- id: step-7
name: Execute action for ${{ matrix.distributions.distribution7.user-id }}
uses: ./
with:
distribution: ${{ matrix.distributions.distribution7.user-id }}
set-as-default: false
- id: step-8
name: Test - wsl-bash_${{ matrix.distributions.distribution1.user-id }} should use the correct distribution
shell: wsl-bash_Debian {0}
run: |-
Expand All @@ -1623,68 +1587,59 @@ jobs:
if: |-
always()
&& (steps.step-1.outcome == 'success')
- id: step-9
- id: step-8
name: Test - wsl-bash_${{ matrix.distributions.distribution2.user-id }} should use the correct distribution
shell: wsl-bash_Alpine {0}
shell: wsl-bash_kali-linux {0}
run: |-
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)
[[ "$(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 }} ]]
if: |-
always()
&& (steps.step-2.outcome == 'success')
- id: step-10
- id: step-9
name: Test - wsl-bash_${{ matrix.distributions.distribution3.user-id }} should use the correct distribution
shell: wsl-bash_kali-linux {0}
shell: wsl-bash_openSUSE-Leap-15.2 {0}
run: |-
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)
[[ "$(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 }} ]]
if: |-
always()
&& (steps.step-3.outcome == 'success')
- id: step-11
- id: step-10
name: Test - wsl-bash_${{ matrix.distributions.distribution4.user-id }} should use the correct distribution
shell: wsl-bash_openSUSE-Leap-15.2 {0}
shell: wsl-bash_Ubuntu-22.04 {0}
run: |-
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)
[[ "$(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 }} ]]
if: |-
always()
&& (steps.step-4.outcome == 'success')
- id: step-12
name: Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution
shell: wsl-bash_Ubuntu-22.04 {0}
&& (matrix.distributions.distribution4.user-id != 'Ubuntu-20.04')
- id: step-11
name: Test - wsl-bash_${{ matrix.distributions.distribution4.user-id }} should use the correct distribution
shell: wsl-bash_Ubuntu-20.04 {0}
run: |-
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)
[[ "$(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 }} ]]
[[ "$(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 }} ]]
if: |-
always()
&& (steps.step-5.outcome == 'success')
&& (matrix.distributions.distribution5.user-id != 'Ubuntu-20.04')
- id: step-13
&& (steps.step-4.outcome == 'success')
&& (matrix.distributions.distribution4.user-id != 'Ubuntu-22.04')
- id: step-12
name: Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution
shell: wsl-bash_Ubuntu-20.04 {0}
shell: wsl-bash_Ubuntu-18.04 {0}
run: |-
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)
[[ "$(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 }} ]]
if: |-
always()
&& (steps.step-5.outcome == 'success')
&& (matrix.distributions.distribution5.user-id != 'Ubuntu-22.04')
- id: step-14
- id: step-13
name: Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should use the correct distribution
shell: wsl-bash_Ubuntu-18.04 {0}
shell: wsl-bash_Ubuntu-16.04 {0}
run: |-
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)
[[ "$(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 }} ]]
if: |-
always()
&& (steps.step-6.outcome == 'success')
- id: step-15
name: Test - wsl-bash_${{ matrix.distributions.distribution7.user-id }} should use the correct distribution
shell: wsl-bash_Ubuntu-16.04 {0}
run: |-
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)
[[ "$(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 }} ]]
if: |-
always()
&& (steps.step-7.outcome == 'success')

0 comments on commit 7b8ba9b

Please sign in to comment.