diff --git a/.github/workflows/test.main.kts b/.github/workflows/test.main.kts index 443de000..32785687 100755 --- a/.github/workflows/test.main.kts +++ b/.github/workflows/test.main.kts @@ -42,10 +42,10 @@ import io.github.typesafegithub.workflows.actions.vampire.SetupWsl import io.github.typesafegithub.workflows.actions.vampire.SetupWsl.Distribution.Debian import io.github.typesafegithub.workflows.actions.vampire.SetupWsl.Distribution.Ubuntu1604 import io.github.typesafegithub.workflows.actions.vampire.SetupWsl.Distribution.Ubuntu1804 -import io.github.typesafegithub.workflows.domain.CommandStep +import io.github.typesafegithub.workflows.domain.AbstractResult.Status.Success import io.github.typesafegithub.workflows.domain.ActionStep +import io.github.typesafegithub.workflows.domain.CommandStep import io.github.typesafegithub.workflows.domain.JobOutputs.EMPTY -import io.github.typesafegithub.workflows.domain.AbstractResult.Status.Success import io.github.typesafegithub.workflows.domain.RunnerType import io.github.typesafegithub.workflows.domain.RunnerType.WindowsLatest import io.github.typesafegithub.workflows.domain.Shell @@ -66,17 +66,96 @@ val environments = listOf( "windows-latest" ) -val debian = Distribution( - wslId = "Debian", - userId = "Debian", - matchPattern = "*Debian*", - defaultAbsentTool = "dos2unix" +val alpine323 = Distribution( + wslId = "Alpine-3.23", + matchPattern = "*Alpine*3.23*", + defaultAbsentTool = "dos2unix", + createTestUserCommand = "adduser -D test" +) + +val alpine322 = Distribution( + wslId = "Alpine-3.22", + matchPattern = "*Alpine*3.22*", + defaultAbsentTool = "dos2unix", + createTestUserCommand = "adduser -D test" +) + +val alpine321 = Distribution( + wslId = "Alpine-3.21", + matchPattern = "*Alpine*3.21*", + defaultAbsentTool = "dos2unix", + createTestUserCommand = "adduser -D test" +) + +val alpine320 = Distribution( + wslId = "Alpine-3.20", + matchPattern = "*Alpine*3.20*", + defaultAbsentTool = "dos2unix", + createTestUserCommand = "adduser -D test" +) + +val alpine319 = Distribution( + wslId = "Alpine-3.19", + matchPattern = "*Alpine*3.19*", + defaultAbsentTool = "dos2unix", + createTestUserCommand = "adduser -D test" +) + +val alpine318 = Distribution( + wslId = "Alpine-3.18", + matchPattern = "*Alpine*3.18*", + defaultAbsentTool = "dos2unix", + createTestUserCommand = "adduser -D test" +) + +val alpine317 = Distribution( + wslId = "Alpine", + userId = "Alpine-3.17", + matchPattern = "*Alpine*3.17*", + defaultAbsentTool = "dos2unix", + createTestUserCommand = "adduser -D test" ) val alpine = Distribution( wslId = "Alpine", - userId = "Alpine", - matchPattern = "*Alpine*", + matchPattern = "*Alpine*3.17*", + defaultAbsentTool = "dos2unix", + createTestUserCommand = "adduser -D test" +) + +val alpineDistributions = listOf( + alpine323, + alpine322, + alpine321, + alpine320, + alpine319, + alpine318, + alpine317, + alpine +) + +val debian13 = Distribution( + wslId = "Debian-13", + matchPattern = "*Debian*13*", + defaultAbsentTool = "dos2unix" +) + +val debian12 = Distribution( + wslId = "Debian-12", + matchPattern = "*Debian*12*", + defaultAbsentTool = "dos2unix" +) + +val debian11 = Distribution( + wslId = "Debian", + userId = "Debian-11", + matchPattern = "*Debian*11*", + defaultAbsentTool = "dos2unix" +) + +val debian = Distribution( + wslId = "Debian", + matchPattern = "*Debian*11*", defaultAbsentTool = "dos2unix" ) @@ -89,14 +168,12 @@ val kali = Distribution( val openSuseLeap15_2 = Distribution( wslId = "openSUSE-Leap-15.2", - userId = "openSUSE-Leap-15.2", matchPattern = "*openSUSE*Leap*15.2*", defaultAbsentTool = "which" ) val ubuntu2404 = Distribution( wslId = "Ubuntu-24.04", - userId = "Ubuntu-24.04", matchPattern = "*Ubuntu*24.04*", defaultAbsentTool = "dos2unix" ) @@ -117,22 +194,22 @@ val ubuntu2004 = Distribution( val ubuntu1804 = Distribution( wslId = "Ubuntu-18.04", - userId = "Ubuntu-18.04", matchPattern = "*Ubuntu*18.04*", defaultAbsentTool = "dos2unix" ) val ubuntu1604 = Distribution( wslId = "Ubuntu-16.04", - userId = "Ubuntu-16.04", matchPattern = "*Ubuntu*16.04*", defaultAbsentTool = "dos2unix" ) val distributions = listOf( + *alpineDistributions.toTypedArray(), + debian13, + debian12, + debian11, debian, - // disable testing on Alpine for the time being due to https://github.com/Vampire/setup-wsl/issues/82 - //alpine, kali, openSuseLeap15_2, ubuntu2404, @@ -379,7 +456,11 @@ workflowWithCopyright( ) verifyFailure( name = "Test - wsl-bash should fail if bash is not present by default", - conditionTransformer = { executeActionStep.getSuccessOnDistributionCondition(alpine) }, + conditionTransformer = { + executeActionStep.getSuccessOnDistributionCondition( + *alpineDistributions.toTypedArray() + ) + }, verificationShell = null, verificationTransformer = { _, command -> """wsl sh -euc "${command.replace("==", "=")}"""" @@ -392,7 +473,9 @@ workflowWithCopyright( additionalPackages = listOf("bash"), wslVersion = null ), - condition = executeActionStep.getSuccessOnDistributionCondition(alpine) + condition = executeActionStep.getSuccessOnDistributionCondition( + *alpineDistributions.toTypedArray() + ) ) commonTests() verifyFailure( @@ -471,7 +554,7 @@ workflowWithCopyright( ) runAfterSuccess( name = "Add user test", - command = "useradd -m -p 4qBD5NWD3IkbU test" + command = expr("matrix.distribution.create-test-user-command") ) executeActionStep = usesSelfAfterSuccess( name = "Set wsl-bash wrapper to use user test by default", @@ -624,13 +707,15 @@ workflowWithCopyright( additionalPackages = listOf("bash"), wslVersion = null ), - condition = executeActionStep.getSuccessOnDistributionCondition(alpine) + condition = executeActionStep.getSuccessOnDistributionCondition( + *alpineDistributions.toTypedArray() + ) ) runAfterSuccess( - name = "Test - /etc/wsl.conf should exist", + name = "Test - /etc/wsl.conf should have expected content", command = """ [ -f /etc/wsl.conf ] - cat /etc/wsl.conf + diff -u <(echo -e '[automount]\noptions = uid=1000') /etc/wsl.conf """ ) runAfterSuccess( @@ -665,12 +750,19 @@ workflowWithCopyright( additionalPackages = listOf("bash"), wslVersion = null ), - condition = executeActionStep.getSuccessOnDistributionCondition(alpine) + condition = executeActionStep.getSuccessOnDistributionCondition( + *alpineDistributions.toTypedArray() + ) ) runAfterSuccess( - name = "Test - /etc/wsl.conf should not exist", - command = "[ ! -f /etc/wsl.conf ] || { cat /etc/wsl.conf; false; }", - conditionTransformer = { executeActionStep.getSuccessNotOnDistributionCondition(ubuntu2404) } + name = "Test - /etc/wsl.conf should not exist or not have the content we will put there", + command = """ + if [ -f /etc/wsl.conf ]; then + if diff -u <(echo -e '[automount]\nroot = /') /etc/wsl.conf; then + false + fi + fi + """ ) runAfterSuccess( name = "Test - C: should be mounted at /mnt/c", @@ -696,10 +788,10 @@ workflowWithCopyright( ) ) runAfterSuccess( - name = "Test - /etc/wsl.conf should exist", + name = "Test - /etc/wsl.conf should have expected content", command = """ [ -f /etc/wsl.conf ] - cat /etc/wsl.conf + diff -u <(echo -e '[automount]\nroot = /') /etc/wsl.conf """ ) runAfterSuccess( @@ -784,10 +876,10 @@ workflowWithCopyright( additionalPackages = listOf( expr( """ - (matrix.distribution.user-id == '${alpine.userId}') - && 'bash' - || '' - """.trimIndent() + (${getOnDistributionCondition(*alpineDistributions.toTypedArray())}) + && 'bash' + || '' + """.trimIndent() ) ), wslVersion = null, @@ -865,10 +957,10 @@ workflowWithCopyright( additionalPackages = listOf( expr( """ - (matrix.distribution.user-id == '${alpine.userId}') - && 'bash' - || '' - """.trimIndent() + (${getOnDistributionCondition(*alpineDistributions.toTypedArray())}) + && 'bash' + || '' + """.trimIndent() ) ), wslVersion = null @@ -901,34 +993,34 @@ workflowWithCopyright( "environment" to environments, "distributions" to listOf( mapOf( - "distribution1" to debian, + "distribution1" to debian11, "distribution2" to ubuntu2004, "distribution3" to ubuntu1804 ), mapOf( - "distribution1" to debian, + "distribution1" to debian11, "distribution2" to ubuntu1804, "distribution3" to ubuntu2004 ), mapOf( "distribution1" to ubuntu2004, - "distribution2" to debian, + "distribution2" to debian11, "distribution3" to ubuntu1804 ), mapOf( "distribution1" to ubuntu2004, "distribution2" to ubuntu1804, - "distribution3" to debian + "distribution3" to debian11 ), mapOf( "distribution1" to ubuntu1804, - "distribution2" to debian, + "distribution2" to debian11, "distribution3" to ubuntu2004 ), mapOf( "distribution1" to ubuntu1804, "distribution2" to ubuntu2004, - "distribution3" to debian + "distribution3" to debian11 ) ).map { it.mapValues { (_, distribution) -> distribution.asMap } @@ -991,18 +1083,18 @@ workflowWithCopyright( "matrix" to mapOf( "environment" to environments, "distribution" to distributions, - "distribution2" to listOf(debian).map { it.asMap }, + "distribution2" to listOf(debian11).map { it.asMap }, "exclude" to environments.map { mapOf( "environment" to it, - "distribution" to debian.asMap, - "distribution2" to debian.asMap + "distribution" to debian11.asMap, + "distribution2" to debian11.asMap ) }, "include" to environments.map { mapOf( "environment" to it, - "distribution" to debian.asMap, + "distribution" to debian11.asMap, "distribution2" to ubuntu2004.asMap ) } @@ -1017,10 +1109,10 @@ workflowWithCopyright( additionalPackages = listOf( expr( """ - |(matrix.distribution.user-id != '${kali.userId}') - |&& 'bash' - ||| '' - """.trimMargin() + (matrix.distribution.user-id != '${kali.userId}') + && 'bash' + || '' + """.trimIndent() ) ), // part of work-around for https://bugs.kali.org/view.php?id=8921 @@ -1139,7 +1231,15 @@ workflowWithCopyright( name = "Execute action for ${expr("matrix.distributions.distribution$it.user-id")}", action = SetupWsl( distribution = SetupWsl.Distribution.Custom(expr("matrix.distributions.distribution$it.user-id")), - //additionalPackages = if (it == 2) listOf("bash") else null, + additionalPackages = listOf( + expr( + """ + (${getOnDistributionCondition(it, *alpineDistributions.toTypedArray())}) + && 'bash' + || '' + """.trimIndent() + ) + ), setAsDefault = if (it >= 3) false else null, wslVersion = 1 ) @@ -1150,7 +1250,7 @@ workflowWithCopyright( verifyInstalledDistribution( name = "Test - wsl-bash_${expr("matrix.distributions.distribution$i.user-id")} should use the correct distribution", conditionTransformer = if (distributions[i] == ubuntu2004.asMap) { - { executeActionStep.getSuccessNotOnDistributionCondition(ubuntu2004, i) } + { executeActionStep.getSuccessNotOnDistributionCondition(i, ubuntu2004) } } else { { it } }, @@ -1162,7 +1262,7 @@ workflowWithCopyright( if (distributions[i] == ubuntu2004.asMap) { verifyInstalledDistribution( name = "Test - wsl-bash_${expr("matrix.distributions.distribution$i.user-id")} should use the correct distribution", - conditionTransformer = { executeActionStep.getSuccessNotOnDistributionCondition(ubuntu2204, i) }, + conditionTransformer = { executeActionStep.getSuccessNotOnDistributionCondition(i, ubuntu2204) }, shell = Shell.Custom("wsl-bash_${distributions[i]["user-id"]} {0}"), expectedPatternExpression = "matrix.distributions.distribution$i.match-pattern" ) @@ -1183,7 +1283,7 @@ fun JobBuilder<*>.commonTests() { // do not just rely on false here, but explicitly use exit // in case failing commands do not make the script fail // and use "shell = Cmd" to capture that the wrapper script is hiding errors - "IF '${expr("${provocationStep.outcome}") }' NEQ 'failure' EXIT /B 1" + "IF '${expr("${provocationStep.outcome}")}' NEQ 'failure' EXIT /B 1" } ) verifyFailure( @@ -1253,7 +1353,11 @@ fun JobBuilder<*>.usesSelf( ) fun JobBuilder<*>.deleteWslBashOnAlpine() = deleteWslBash( - conditionTransformer = { executeActionStep.getSuccessOnDistributionCondition(alpine)} + conditionTransformer = { + executeActionStep.getSuccessOnDistributionCondition( + *alpineDistributions.toTypedArray() + ) + } ) fun JobBuilder<*>.deleteWslBash( @@ -1363,18 +1467,55 @@ val Step<*>.successCondition && (${outcome.eq(Success)}) """.trimIndent() -fun Step<*>.getSuccessOnDistributionCondition(distribution: Distribution, i: Int? = null) = - getSuccessOnOrNotOnDistributionCondition(distribution, true, i) +fun Step<*>.getSuccessOnDistributionCondition(vararg distributions: Distribution) = + getSuccessOnOrNotOnDistributionCondition(distributions, true, null) -fun Step<*>.getSuccessNotOnDistributionCondition(distribution: Distribution, i: Int? = null) = - getSuccessOnOrNotOnDistributionCondition(distribution, false, i) +fun Step<*>.getSuccessOnDistributionCondition(i: Int, vararg distributions: Distribution) = + getSuccessOnOrNotOnDistributionCondition(distributions, true, i) -fun Step<*>.getSuccessOnOrNotOnDistributionCondition(distribution: Distribution, on: Boolean = true, i: Int? = null) = """ - |( - ${successCondition.prependIndent("| ")} - |) - |&& (matrix.${i?.let { "distributions.distribution$it" } ?: "distribution"}.user-id ${if (on) "==" else "!="} '${distribution.userId}') -""".trimMargin() +fun Step<*>.getSuccessNotOnDistributionCondition(vararg distributions: Distribution) = + getSuccessOnOrNotOnDistributionCondition(distributions, false, null) + +fun Step<*>.getSuccessNotOnDistributionCondition(i: Int, vararg distributions: Distribution) = + getSuccessOnOrNotOnDistributionCondition(distributions, false, i) + +fun Step<*>.getSuccessOnOrNotOnDistributionCondition(distributions: Array, on: Boolean = true, i: Int? = null): String { + return """ + |( + ${successCondition.prependIndent("| ")} + |) + |&& (${getOnOrNotOnDistributionCondition(distributions, on, i)}) + """.trimMargin() +} + +fun getOnDistributionCondition(vararg distributions: Distribution) = + getOnOrNotOnDistributionCondition(distributions, true, null) + +fun getOnDistributionCondition(i: Int, vararg distributions: Distribution) = + getOnOrNotOnDistributionCondition(distributions, true, i) + +fun getNotOnDistributionCondition(vararg distributions: Distribution) = + getOnOrNotOnDistributionCondition(distributions, false, null) + +fun getNotOnDistributionCondition(i: Int, vararg distributions: Distribution) = + getOnOrNotOnDistributionCondition(distributions, false, i) + +fun getOnOrNotOnDistributionCondition( + distributions: Array, + on: Boolean = true, + i: Int? = null +): String { + val contains = "${if (on) "" else "!"}contains" + val distributionsJson = distributions.joinToString( + separator = """", """", + prefix = """fromJSON('["""", + postfix = """"]')""" + ) { + it.userId + } + val distribution = "matrix.${i?.let { "distributions.distribution$it" } ?: "distribution"}.user-id" + return "$contains($distributionsJson, $distribution)" +} // part of work-around for https://bugs.kali.org/view.php?id=8921 // and https://bugs.kali.org/view.php?id=6672 @@ -1394,14 +1535,16 @@ fun getWslVersionExpression(vararg wsl2Distributions: Distribution) = """ data class Distribution( val wslId: String, - val userId: String, + val userId: String = wslId, val matchPattern: String, - val defaultAbsentTool: String + val defaultAbsentTool: String, + val createTestUserCommand: String = "useradd -m -p 4qBD5NWD3IkbU test" ) { val asMap = mapOf( "wsl-id" to wslId, "user-id" to userId, "match-pattern" to matchPattern, - "default-absent-tool" to defaultAbsentTool + "default-absent-tool" to defaultAbsentTool, + "create-test-user-command" to createTestUserCommand ) } diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index da925ac8..9f548331 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -180,8 +180,9 @@ jobs: distribution: - wsl-id: 'Debian' user-id: 'Debian' - match-pattern: '*Debian*' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' steps: - id: 'step-0' name: 'Install zstd on windows-11-arm' @@ -388,38 +389,101 @@ jobs: - 'windows-2025' - 'windows-latest' distribution: + - wsl-id: 'Alpine-3.23' + user-id: 'Alpine-3.23' + match-pattern: '*Alpine*3.23*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.22' + user-id: 'Alpine-3.22' + match-pattern: '*Alpine*3.22*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.21' + user-id: 'Alpine-3.21' + match-pattern: '*Alpine*3.21*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.20' + user-id: 'Alpine-3.20' + match-pattern: '*Alpine*3.20*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.19' + user-id: 'Alpine-3.19' + match-pattern: '*Alpine*3.19*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.18' + user-id: 'Alpine-3.18' + match-pattern: '*Alpine*3.18*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine-3.17' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Debian-13' + user-id: 'Debian-13' + match-pattern: '*Debian*13*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian-12' + user-id: 'Debian-12' + match-pattern: '*Debian*12*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Debian' user-id: 'Debian' - match-pattern: '*Debian*' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'MyDistribution' user-id: 'kali-linux' match-pattern: '*Kali*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'openSUSE-Leap-15.2' user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: 'which' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-24.04' user-id: 'Ubuntu-24.04' match-pattern: '*Ubuntu*24.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-16.04' user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' steps: - id: 'step-0' name: 'Install zstd on windows-11-arm' @@ -457,7 +521,7 @@ jobs: always() && (steps.step-2.outcome == 'success') ) - && (matrix.distribution.user-id == 'Alpine') + && (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distribution.user-id)) - id: 'step-4' name: 'Test - wsl-bash should fail if bash is not present by default (verification)' run: 'wsl sh -euc "[ ''${{ steps.step-3.outcome }}'' = ''failure'' ]"' @@ -466,7 +530,7 @@ jobs: always() && (steps.step-2.outcome == 'success') ) - && (matrix.distribution.user-id == 'Alpine') + && (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distribution.user-id)) - id: 'step-5' name: 'Delete wsl-bash' shell: 'cmd' @@ -476,7 +540,7 @@ jobs: always() && (steps.step-2.outcome == 'success') ) - && (matrix.distribution.user-id == 'Alpine') + && (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distribution.user-id)) - id: 'step-6' name: 'Install Bash on Alpine' uses: './' @@ -488,7 +552,7 @@ jobs: always() && (steps.step-2.outcome == 'success') ) - && (matrix.distribution.user-id == 'Alpine') + && (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distribution.user-id)) - id: 'step-7' name: 'Test - wsl-bash should be available as custom shell' shell: 'wsl-bash {0}' @@ -721,7 +785,7 @@ jobs: - id: 'step-36' name: 'Add user test' shell: 'wsl-bash {0}' - run: 'useradd -m -p 4qBD5NWD3IkbU test' + run: '${{ matrix.distribution.create-test-user-command }}' if: |- always() && (steps.step-32.outcome == 'success') @@ -908,38 +972,101 @@ jobs: - 'windows-2025' - 'windows-latest' distribution: + - wsl-id: 'Alpine-3.23' + user-id: 'Alpine-3.23' + match-pattern: '*Alpine*3.23*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.22' + user-id: 'Alpine-3.22' + match-pattern: '*Alpine*3.22*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.21' + user-id: 'Alpine-3.21' + match-pattern: '*Alpine*3.21*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.20' + user-id: 'Alpine-3.20' + match-pattern: '*Alpine*3.20*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.19' + user-id: 'Alpine-3.19' + match-pattern: '*Alpine*3.19*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.18' + user-id: 'Alpine-3.18' + match-pattern: '*Alpine*3.18*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine-3.17' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Debian-13' + user-id: 'Debian-13' + match-pattern: '*Debian*13*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian-12' + user-id: 'Debian-12' + match-pattern: '*Debian*12*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Debian' user-id: 'Debian' - match-pattern: '*Debian*' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'MyDistribution' user-id: 'kali-linux' match-pattern: '*Kali*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'openSUSE-Leap-15.2' user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: 'which' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-24.04' user-id: 'Ubuntu-24.04' match-pattern: '*Ubuntu*24.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-16.04' user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' steps: - id: 'step-0' name: 'Install zstd on windows-11-arm' @@ -973,7 +1100,7 @@ jobs: always() && (steps.step-2.outcome == 'success') ) - && (matrix.distribution.user-id == 'Alpine') + && (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distribution.user-id)) - id: 'step-4' name: 'Install Bash on Alpine' uses: './' @@ -985,13 +1112,13 @@ jobs: always() && (steps.step-2.outcome == 'success') ) - && (matrix.distribution.user-id == 'Alpine') + && (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distribution.user-id)) - id: 'step-5' - name: 'Test - /etc/wsl.conf should exist' + name: 'Test - /etc/wsl.conf should have expected content' shell: 'wsl-bash {0}' run: |- [ -f /etc/wsl.conf ] - cat /etc/wsl.conf + diff -u <(echo -e '[automount]\noptions = uid=1000') /etc/wsl.conf if: |- always() && (steps.step-2.outcome == 'success') @@ -1018,38 +1145,101 @@ jobs: - 'windows-2025' - 'windows-latest' distribution: + - wsl-id: 'Alpine-3.23' + user-id: 'Alpine-3.23' + match-pattern: '*Alpine*3.23*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.22' + user-id: 'Alpine-3.22' + match-pattern: '*Alpine*3.22*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.21' + user-id: 'Alpine-3.21' + match-pattern: '*Alpine*3.21*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.20' + user-id: 'Alpine-3.20' + match-pattern: '*Alpine*3.20*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.19' + user-id: 'Alpine-3.19' + match-pattern: '*Alpine*3.19*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.18' + user-id: 'Alpine-3.18' + match-pattern: '*Alpine*3.18*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine-3.17' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Debian-13' + user-id: 'Debian-13' + match-pattern: '*Debian*13*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian-12' + user-id: 'Debian-12' + match-pattern: '*Debian*12*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Debian' user-id: 'Debian' - match-pattern: '*Debian*' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'MyDistribution' user-id: 'kali-linux' match-pattern: '*Kali*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'openSUSE-Leap-15.2' user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: 'which' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-24.04' user-id: 'Ubuntu-24.04' match-pattern: '*Ubuntu*24.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-16.04' user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' steps: - id: 'step-0' name: 'Install zstd on windows-11-arm' @@ -1080,7 +1270,7 @@ jobs: always() && (steps.step-2.outcome == 'success') ) - && (matrix.distribution.user-id == 'Alpine') + && (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distribution.user-id)) - id: 'step-4' name: 'Install Bash on Alpine' uses: './' @@ -1092,17 +1282,19 @@ jobs: always() && (steps.step-2.outcome == 'success') ) - && (matrix.distribution.user-id == 'Alpine') + && (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distribution.user-id)) - id: 'step-5' - name: 'Test - /etc/wsl.conf should not exist' + name: 'Test - /etc/wsl.conf should not exist or not have the content we will put there' shell: 'wsl-bash {0}' - run: '[ ! -f /etc/wsl.conf ] || { cat /etc/wsl.conf; false; }' + run: |- + if [ -f /etc/wsl.conf ]; then + if diff -u <(echo -e '[automount]\nroot = /') /etc/wsl.conf; then + false + fi + fi if: |- - ( - always() - && (steps.step-2.outcome == 'success') - ) - && (matrix.distribution.user-id != 'Ubuntu-24.04') + always() + && (steps.step-2.outcome == 'success') - id: 'step-6' name: 'Test - C: should be mounted at /mnt/c' shell: 'wsl-bash {0}' @@ -1133,11 +1325,11 @@ jobs: always() && (steps.step-2.outcome == 'success') - id: 'step-9' - name: 'Test - /etc/wsl.conf should exist' + name: 'Test - /etc/wsl.conf should have expected content' shell: 'wsl-bash {0}' run: |- [ -f /etc/wsl.conf ] - cat /etc/wsl.conf + diff -u <(echo -e '[automount]\nroot = /') /etc/wsl.conf if: |- always() && (steps.step-8.outcome == 'success') @@ -1164,38 +1356,101 @@ jobs: - 'windows-2025' - 'windows-latest' distribution: + - wsl-id: 'Alpine-3.23' + user-id: 'Alpine-3.23' + match-pattern: '*Alpine*3.23*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.22' + user-id: 'Alpine-3.22' + match-pattern: '*Alpine*3.22*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.21' + user-id: 'Alpine-3.21' + match-pattern: '*Alpine*3.21*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.20' + user-id: 'Alpine-3.20' + match-pattern: '*Alpine*3.20*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.19' + user-id: 'Alpine-3.19' + match-pattern: '*Alpine*3.19*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.18' + user-id: 'Alpine-3.18' + match-pattern: '*Alpine*3.18*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine-3.17' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Debian-13' + user-id: 'Debian-13' + match-pattern: '*Debian*13*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian-12' + user-id: 'Debian-12' + match-pattern: '*Debian*12*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Debian' user-id: 'Debian' - match-pattern: '*Debian*' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'MyDistribution' user-id: 'kali-linux' match-pattern: '*Kali*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'openSUSE-Leap-15.2' user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: 'which' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-24.04' user-id: 'Ubuntu-24.04' match-pattern: '*Ubuntu*24.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-16.04' user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' steps: - id: 'step-0' name: 'Install zstd on windows-11-arm' @@ -1258,38 +1513,101 @@ jobs: - 'windows-2025' - 'windows-latest' distribution: + - wsl-id: 'Alpine-3.23' + user-id: 'Alpine-3.23' + match-pattern: '*Alpine*3.23*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.22' + user-id: 'Alpine-3.22' + match-pattern: '*Alpine*3.22*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.21' + user-id: 'Alpine-3.21' + match-pattern: '*Alpine*3.21*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.20' + user-id: 'Alpine-3.20' + match-pattern: '*Alpine*3.20*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.19' + user-id: 'Alpine-3.19' + match-pattern: '*Alpine*3.19*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.18' + user-id: 'Alpine-3.18' + match-pattern: '*Alpine*3.18*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine-3.17' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Debian-13' + user-id: 'Debian-13' + match-pattern: '*Debian*13*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian-12' + user-id: 'Debian-12' + match-pattern: '*Debian*12*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Debian' user-id: 'Debian' - match-pattern: '*Debian*' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'MyDistribution' user-id: 'kali-linux' match-pattern: '*Kali*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'openSUSE-Leap-15.2' user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: 'which' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-24.04' user-id: 'Ubuntu-24.04' match-pattern: '*Ubuntu*24.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-16.04' user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' wsl-version: - 1 - 2 @@ -1314,7 +1632,7 @@ jobs: with: distribution: '${{ matrix.distribution.user-id }}' additional-packages: |- - ${{ (matrix.distribution.user-id == 'Alpine') + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distribution.user-id)) && 'bash' || '' }} wsl-version: '${{ matrix.wsl-version }}' @@ -1396,38 +1714,101 @@ jobs: - 'windows-2025' - 'windows-latest' distribution: + - wsl-id: 'Alpine-3.23' + user-id: 'Alpine-3.23' + match-pattern: '*Alpine*3.23*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.22' + user-id: 'Alpine-3.22' + match-pattern: '*Alpine*3.22*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.21' + user-id: 'Alpine-3.21' + match-pattern: '*Alpine*3.21*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.20' + user-id: 'Alpine-3.20' + match-pattern: '*Alpine*3.20*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.19' + user-id: 'Alpine-3.19' + match-pattern: '*Alpine*3.19*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.18' + user-id: 'Alpine-3.18' + match-pattern: '*Alpine*3.18*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine-3.17' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Debian-13' + user-id: 'Debian-13' + match-pattern: '*Debian*13*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian-12' + user-id: 'Debian-12' + match-pattern: '*Debian*12*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Debian' user-id: 'Debian' - match-pattern: '*Debian*' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'MyDistribution' user-id: 'kali-linux' match-pattern: '*Kali*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'openSUSE-Leap-15.2' user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: 'which' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-24.04' user-id: 'Ubuntu-24.04' match-pattern: '*Ubuntu*24.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-16.04' user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' steps: - id: 'step-0' name: 'Install zstd on windows-11-arm' @@ -1449,7 +1830,7 @@ jobs: with: distribution: '${{ matrix.distribution.user-id }}' additional-packages: |- - ${{ (matrix.distribution.user-id == 'Alpine') + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distribution.user-id)) && 'bash' || '' }} - id: 'step-3' @@ -1477,94 +1858,112 @@ jobs: distributions: - distribution1: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution3: wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - distribution1: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution3: wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - distribution1: wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution3: wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - distribution1: wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution3: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - distribution1: wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution3: wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - distribution1: wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution3: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' steps: - id: 'step-0' name: 'Install zstd on windows-11-arm' @@ -1636,111 +2035,187 @@ jobs: - 'windows-2025' - 'windows-latest' distribution: + - wsl-id: 'Alpine-3.23' + user-id: 'Alpine-3.23' + match-pattern: '*Alpine*3.23*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.22' + user-id: 'Alpine-3.22' + match-pattern: '*Alpine*3.22*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.21' + user-id: 'Alpine-3.21' + match-pattern: '*Alpine*3.21*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.20' + user-id: 'Alpine-3.20' + match-pattern: '*Alpine*3.20*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.19' + user-id: 'Alpine-3.19' + match-pattern: '*Alpine*3.19*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine-3.18' + user-id: 'Alpine-3.18' + match-pattern: '*Alpine*3.18*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine-3.17' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + - wsl-id: 'Debian-13' + user-id: 'Debian-13' + match-pattern: '*Debian*13*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian-12' + user-id: 'Debian-12' + match-pattern: '*Debian*12*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + - wsl-id: 'Debian' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Debian' user-id: 'Debian' - match-pattern: '*Debian*' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'MyDistribution' user-id: 'kali-linux' match-pattern: '*Kali*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'openSUSE-Leap-15.2' user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: 'which' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-24.04' user-id: 'Ubuntu-24.04' match-pattern: '*Ubuntu*24.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - wsl-id: 'Ubuntu-16.04' user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: - wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' exclude: - environment: 'windows-2022' distribution: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - environment: 'windows-2025' distribution: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - environment: 'windows-latest' distribution: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' include: - environment: 'windows-2022' distribution: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - environment: 'windows-2025' distribution: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - environment: 'windows-latest' distribution: wsl-id: 'Debian' - user-id: 'Debian' - match-pattern: '*Debian*' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' distribution2: wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' steps: - id: 'step-0' name: 'Install zstd on windows-11-arm' @@ -1877,76 +2352,222 @@ jobs: distributions: - incompatibleUbuntu: 'Ubuntu-22.04' distribution1: + wsl-id: 'Alpine-3.23' + user-id: 'Alpine-3.23' + match-pattern: '*Alpine*3.23*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution2: + wsl-id: 'Alpine-3.22' + user-id: 'Alpine-3.22' + match-pattern: '*Alpine*3.22*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution3: + wsl-id: 'Alpine-3.21' + user-id: 'Alpine-3.21' + match-pattern: '*Alpine*3.21*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution4: + wsl-id: 'Alpine-3.20' + user-id: 'Alpine-3.20' + match-pattern: '*Alpine*3.20*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution5: + wsl-id: 'Alpine-3.19' + user-id: 'Alpine-3.19' + match-pattern: '*Alpine*3.19*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution6: + wsl-id: 'Alpine-3.18' + user-id: 'Alpine-3.18' + match-pattern: '*Alpine*3.18*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution7: + wsl-id: 'Alpine' + user-id: 'Alpine-3.17' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution8: + wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution9: + wsl-id: 'Debian-13' + user-id: 'Debian-13' + match-pattern: '*Debian*13*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution10: + wsl-id: 'Debian-12' + user-id: 'Debian-12' + match-pattern: '*Debian*12*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution11: + wsl-id: 'Debian' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution12: wsl-id: 'Debian' user-id: 'Debian' - match-pattern: '*Debian*' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' - distribution2: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution13: wsl-id: 'MyDistribution' user-id: 'kali-linux' match-pattern: '*Kali*' default-absent-tool: 'dos2unix' - distribution3: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution14: wsl-id: 'openSUSE-Leap-15.2' user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: 'which' - distribution4: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution15: wsl-id: 'Ubuntu-24.04' user-id: 'Ubuntu-24.04' match-pattern: '*Ubuntu*24.04*' default-absent-tool: 'dos2unix' - distribution5: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution16: wsl-id: 'Ubuntu' user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' default-absent-tool: 'dos2unix' - distribution6: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution17: wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' - distribution7: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution18: wsl-id: 'Ubuntu-16.04' user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' - incompatibleUbuntu: 'Ubuntu-20.04' distribution1: + wsl-id: 'Alpine-3.23' + user-id: 'Alpine-3.23' + match-pattern: '*Alpine*3.23*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution2: + wsl-id: 'Alpine-3.22' + user-id: 'Alpine-3.22' + match-pattern: '*Alpine*3.22*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution3: + wsl-id: 'Alpine-3.21' + user-id: 'Alpine-3.21' + match-pattern: '*Alpine*3.21*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution4: + wsl-id: 'Alpine-3.20' + user-id: 'Alpine-3.20' + match-pattern: '*Alpine*3.20*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution5: + wsl-id: 'Alpine-3.19' + user-id: 'Alpine-3.19' + match-pattern: '*Alpine*3.19*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution6: + wsl-id: 'Alpine-3.18' + user-id: 'Alpine-3.18' + match-pattern: '*Alpine*3.18*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution7: + wsl-id: 'Alpine' + user-id: 'Alpine-3.17' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution8: + wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*3.17*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'adduser -D test' + distribution9: + wsl-id: 'Debian-13' + user-id: 'Debian-13' + match-pattern: '*Debian*13*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution10: + wsl-id: 'Debian-12' + user-id: 'Debian-12' + match-pattern: '*Debian*12*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution11: + wsl-id: 'Debian' + user-id: 'Debian-11' + match-pattern: '*Debian*11*' + default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution12: wsl-id: 'Debian' user-id: 'Debian' - match-pattern: '*Debian*' + match-pattern: '*Debian*11*' default-absent-tool: 'dos2unix' - distribution2: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution13: wsl-id: 'MyDistribution' user-id: 'kali-linux' match-pattern: '*Kali*' default-absent-tool: 'dos2unix' - distribution3: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution14: wsl-id: 'openSUSE-Leap-15.2' user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: 'which' - distribution4: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution15: wsl-id: 'Ubuntu-24.04' user-id: 'Ubuntu-24.04' match-pattern: '*Ubuntu*24.04*' default-absent-tool: 'dos2unix' - distribution5: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution16: wsl-id: 'Ubuntu' user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' default-absent-tool: 'dos2unix' - distribution6: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution17: wsl-id: 'Ubuntu-18.04' user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' default-absent-tool: 'dos2unix' - distribution7: + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' + distribution18: wsl-id: 'Ubuntu-16.04' user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' default-absent-tool: 'dos2unix' + create-test-user-command: 'useradd -m -p 4qBD5NWD3IkbU test' steps: - id: 'step-0' name: 'Install zstd on windows-11-arm' @@ -1967,12 +2588,20 @@ jobs: uses: './' with: distribution: '${{ matrix.distributions.distribution1.user-id }}' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution1.user-id)) + && 'bash' + || '' }} wsl-version: '1' - id: 'step-3' name: 'Execute action for ${{ matrix.distributions.distribution2.user-id }}' uses: './' with: distribution: '${{ matrix.distributions.distribution2.user-id }}' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution2.user-id)) + && 'bash' + || '' }} wsl-version: '1' - id: 'step-4' name: 'Execute action for ${{ matrix.distributions.distribution3.user-id }}' @@ -1980,6 +2609,10 @@ jobs: with: distribution: '${{ matrix.distributions.distribution3.user-id }}' set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution3.user-id)) + && 'bash' + || '' }} wsl-version: '1' - id: 'step-5' name: 'Execute action for ${{ matrix.distributions.distribution4.user-id }}' @@ -1987,6 +2620,10 @@ jobs: with: distribution: '${{ matrix.distributions.distribution4.user-id }}' set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution4.user-id)) + && 'bash' + || '' }} wsl-version: '1' - id: 'step-6' name: 'Execute action for ${{ matrix.distributions.distribution5.user-id }}' @@ -1994,6 +2631,10 @@ jobs: with: distribution: '${{ matrix.distributions.distribution5.user-id }}' set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution5.user-id)) + && 'bash' + || '' }} wsl-version: '1' - id: 'step-7' name: 'Execute action for ${{ matrix.distributions.distribution6.user-id }}' @@ -2001,6 +2642,10 @@ jobs: with: distribution: '${{ matrix.distributions.distribution6.user-id }}' set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution6.user-id)) + && 'bash' + || '' }} wsl-version: '1' - id: 'step-8' name: 'Execute action for ${{ matrix.distributions.distribution7.user-id }}' @@ -2008,82 +2653,306 @@ jobs: with: distribution: '${{ matrix.distributions.distribution7.user-id }}' set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution7.user-id)) + && 'bash' + || '' }} wsl-version: '1' - id: 'step-9' + name: 'Execute action for ${{ matrix.distributions.distribution8.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution8.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution8.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-10' + name: 'Execute action for ${{ matrix.distributions.distribution9.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution9.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution9.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-11' + name: 'Execute action for ${{ matrix.distributions.distribution10.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution10.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution10.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-12' + name: 'Execute action for ${{ matrix.distributions.distribution11.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution11.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution11.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-13' + name: 'Execute action for ${{ matrix.distributions.distribution12.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution12.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution12.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-14' + name: 'Execute action for ${{ matrix.distributions.distribution13.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution13.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution13.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-15' + name: 'Execute action for ${{ matrix.distributions.distribution14.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution14.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution14.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-16' + name: 'Execute action for ${{ matrix.distributions.distribution15.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution15.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution15.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-17' + name: 'Execute action for ${{ matrix.distributions.distribution16.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution16.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution16.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-18' + name: 'Execute action for ${{ matrix.distributions.distribution17.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution17.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution17.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-19' + name: 'Execute action for ${{ matrix.distributions.distribution18.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution18.user-id }}' + set-as-default: 'false' + additional-packages: |- + ${{ (contains(fromJSON('["Alpine-3.23", "Alpine-3.22", "Alpine-3.21", "Alpine-3.20", "Alpine-3.19", "Alpine-3.18", "Alpine-3.17", "Alpine"]'), matrix.distributions.distribution18.user-id)) + && 'bash' + || '' }} + wsl-version: '1' + - id: 'step-20' name: 'Test - wsl-bash_${{ matrix.distributions.distribution1.user-id }} should use the correct distribution' - shell: 'wsl-bash_Debian {0}' + shell: 'wsl-bash_Alpine-3.23 {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.distribution1.match-pattern }} ]] if: |- always() && (steps.step-2.outcome == 'success') - - id: 'step-10' + - id: 'step-21' name: 'Test - wsl-bash_${{ matrix.distributions.distribution2.user-id }} should use the correct distribution' - shell: 'wsl-bash_kali-linux {0}' + shell: 'wsl-bash_Alpine-3.22 {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-3.outcome == 'success') - - id: 'step-11' + - id: 'step-22' name: 'Test - wsl-bash_${{ matrix.distributions.distribution3.user-id }} should use the correct distribution' - shell: 'wsl-bash_openSUSE-Leap-15.2 {0}' + shell: 'wsl-bash_Alpine-3.21 {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-4.outcome == 'success') - - id: 'step-12' + - id: 'step-23' name: 'Test - wsl-bash_${{ matrix.distributions.distribution4.user-id }} should use the correct distribution' - shell: 'wsl-bash_Ubuntu-24.04 {0}' + shell: 'wsl-bash_Alpine-3.20 {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-5.outcome == 'success') - - id: 'step-13' + - id: 'step-24' name: 'Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution' - shell: 'wsl-bash_Ubuntu-22.04 {0}' + shell: 'wsl-bash_Alpine-3.19 {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-6.outcome == 'success') + - id: 'step-25' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should use the correct distribution' + shell: 'wsl-bash_Alpine-3.18 {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-7.outcome == 'success') + - id: 'step-26' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution7.user-id }} should use the correct distribution' + shell: 'wsl-bash_Alpine-3.17 {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-8.outcome == 'success') + - id: 'step-27' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution8.user-id }} should use the correct distribution' + shell: 'wsl-bash_Alpine {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.distribution8.match-pattern }} ]] + if: |- + always() + && (steps.step-9.outcome == 'success') + - id: 'step-28' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution9.user-id }} should use the correct distribution' + shell: 'wsl-bash_Debian-13 {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.distribution9.match-pattern }} ]] + if: |- + always() + && (steps.step-10.outcome == 'success') + - id: 'step-29' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution10.user-id }} should use the correct distribution' + shell: 'wsl-bash_Debian-12 {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.distribution10.match-pattern }} ]] + if: |- + always() + && (steps.step-11.outcome == 'success') + - id: 'step-30' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution11.user-id }} should use the correct distribution' + shell: 'wsl-bash_Debian-11 {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.distribution11.match-pattern }} ]] + if: |- + always() + && (steps.step-12.outcome == 'success') + - id: 'step-31' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution12.user-id }} should use the correct distribution' + shell: 'wsl-bash_Debian {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.distribution12.match-pattern }} ]] + if: |- + always() + && (steps.step-13.outcome == 'success') + - id: 'step-32' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution13.user-id }} should use the correct distribution' + 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.distribution13.match-pattern }} ]] + if: |- + always() + && (steps.step-14.outcome == 'success') + - id: 'step-33' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution14.user-id }} should use the correct distribution' + 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.distribution14.match-pattern }} ]] + if: |- + always() + && (steps.step-15.outcome == 'success') + - id: 'step-34' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution15.user-id }} should use the correct distribution' + shell: 'wsl-bash_Ubuntu-24.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.distribution15.match-pattern }} ]] + if: |- + always() + && (steps.step-16.outcome == 'success') + - id: 'step-35' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution16.user-id }} should use the correct distribution' + 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.distribution16.match-pattern }} ]] if: |- ( always() - && (steps.step-6.outcome == 'success') + && (steps.step-17.outcome == 'success') ) - && (matrix.distributions.distribution5.user-id != 'Ubuntu-20.04') - - id: 'step-14' - name: 'Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution' + && (!contains(fromJSON('["Ubuntu-20.04"]'), matrix.distributions.distribution16.user-id)) + - id: 'step-36' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution16.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.distribution16.match-pattern }} ]] if: |- ( always() - && (steps.step-6.outcome == 'success') + && (steps.step-17.outcome == 'success') ) - && (matrix.distributions.distribution5.user-id != 'Ubuntu-22.04') - - id: 'step-15' - name: 'Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should use the correct distribution' + && (!contains(fromJSON('["Ubuntu-22.04"]'), matrix.distributions.distribution16.user-id)) + - id: 'step-37' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution17.user-id }} should use the correct distribution' 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.distribution6.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.distribution17.match-pattern }} ]] if: |- always() - && (steps.step-7.outcome == 'success') - - id: 'step-16' - name: 'Test - wsl-bash_${{ matrix.distributions.distribution7.user-id }} should use the correct distribution' + && (steps.step-18.outcome == 'success') + - id: 'step-38' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution18.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 }} ]] + [[ "$(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.distribution18.match-pattern }} ]] if: |- always() - && (steps.step-8.outcome == 'success') + && (steps.step-19.outcome == 'success') diff --git a/action-types.yml b/action-types.yml index 3ae49220..4b72e178 100644 --- a/action-types.yml +++ b/action-types.yml @@ -1,4 +1,4 @@ -# Copyright 2022 Piotr Krzemiński +# Copyright 2022-2026 Piotr Krzemiński & Björn Kautler # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,17 @@ inputs: distribution: type: enum allowed-values: + - Alpine-3.23 + - Alpine-3.22 + - Alpine-3.21 + - Alpine-3.20 + - Alpine-3.19 + - Alpine-3.18 + - Alpine-3.17 - Alpine + - Debian-13 + - Debian-12 + - Debian-11 - Debian - kali-linux - openSUSE-Leap-15.2 diff --git a/action.yml b/action.yml index 98165760..82e49318 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -# Copyright 2020-2022 Björn Kautler +# Copyright 2020-2026 Björn Kautler # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,26 @@ inputs: 'Ubuntu-22.04' and 'Ubuntu-20.04' can not be used together at the same time. They use the same WSL distribution ID, so the second that is used will not be installed as the first one will be found as already installed by WSL distribution ID. - Valid values: 'Alpine', 'Debian', 'kali-linux', 'openSUSE-Leap-15.2', 'Ubuntu-24.04', 'Ubuntu-22.04', 'Ubuntu-20.04', 'Ubuntu-18.04', 'Ubuntu-16.04' + Valid values: + - 'Alpine-3.23' + - 'Alpine-3.22' + - 'Alpine-3.21' + - 'Alpine-3.20' + - 'Alpine-3.19' + - 'Alpine-3.18' + - 'Alpine-3.17' + - 'Alpine' (deprecated, 'Alpine-3.17' is a drop-in replacement, except for the wsl-shell-distribution-wrapper name) + - 'Debian-13' + - 'Debian-12' + - 'Debian-11' + - 'Debian' (deprecated, 'Debian-11' is a drop-in replacement, except for the wsl-shell-distribution-wrapper name) + - 'kali-linux' + - 'openSUSE-Leap-15.2' + - 'Ubuntu-24.04' + - 'Ubuntu-22.04' + - 'Ubuntu-20.04' + - 'Ubuntu-18.04' + - 'Ubuntu-16.04' required: false default: Debian @@ -48,6 +67,11 @@ inputs: This can be used to adjust various settings as documented at https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configuration-settings-for-wslconf. This can also be used if the distribution is installed already. + + WARNING: Setting this option will overwrite any existing content of the file. + Some distributions like Debian-12+ and Ubuntu-24.04+ ship with a default wsl.conf file. + Make sure to check whether a file exists by default and whether you want to include + its contents in your configured value. required: false set-as-default: diff --git a/gradle.properties b/gradle.properties index 1d3fd581..b57378c0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ # limitations under the License. group = net.kautler -version = 6.0.1-SNAPSHOT +version = 6.1.0-SNAPSHOT description = A GitHub action to install and setup a Linux distribution for the Windows Subsystem for Linux (WSL) org.gradle.jvmargs = -Xmx1g diff --git a/gradle/build-logic/src/main/kotlin/net/kautler/node.gradle.kts b/gradle/build-logic/src/main/kotlin/net/kautler/node.gradle.kts index ad802bce..3b6c6be3 100644 --- a/gradle/build-logic/src/main/kotlin/net/kautler/node.gradle.kts +++ b/gradle/build-logic/src/main/kotlin/net/kautler/node.gradle.kts @@ -44,8 +44,6 @@ kotlin { jsMain { dependencies { implementation(libs.kotlinx.coroutines.core) - implementation(libs.ktor.client.core) - implementation(libs.ktor.client.js) implementation(kotlinWrappers.actions.cache) implementation(kotlinWrappers.actions.core) implementation(kotlinWrappers.actions.exec) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3403f34b..0ae1b304 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,7 +26,6 @@ build-node = "20.11.0" build-snakeyaml = "2.6" kotlin = "2.3.20" kotlinx-coroutines = "1.10.2" -ktor = "3.4.2" workflows-kotlin = "2.3.20" [libraries] @@ -37,8 +36,6 @@ build-kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-ser build-kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json" } build-snakeyaml = { module = "org.yaml:snakeyaml", version.ref = "build-snakeyaml" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } -ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } -ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" } workflows-kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler", version.ref = "workflows-kotlin" } workflows-kotlin-compiler-embeddable = { module = "org.jetbrains.kotlin:kotlin-compiler-embeddable", version.ref = "workflows-kotlin" } workflows-kotlin-main-kts = { module = "org.jetbrains.kotlin:kotlin-main-kts", version.ref = "workflows-kotlin" } diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index 9d249be7..6ddc2f1e 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -848,11 +848,6 @@ wrap-ansi@^8.1.0: string-width "^5.0.1" strip-ansi "^7.0.1" -ws@8.18.3: - version "8.18.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.3.tgz#b56b88abffde62791c639170400c93dcb0c95472" - integrity sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" diff --git a/readme/README_template.md b/readme/README_template.md index 35c6dd90..6a52c0bd 100644 --- a/readme/README_template.md +++ b/readme/README_template.md @@ -145,8 +145,18 @@ so the second that is used will not be installed as the first one will be found WSL distribution ID. The values currently supported by this action are: -* `Debian` **(default)** -* `Alpine` +* `Alpine-3.23` +* `Alpine-3.22` +* `Alpine-3.21` +* `Alpine-3.20` +* `Alpine-3.19` +* `Alpine-3.18` +* `Alpine-3.17` +* `Alpine` _(deprecated, 'Alpine-3.17' is a drop-in replacement, except for the wsl-shell-distribution-wrapper name)_ +* `Debian-13` +* `Debian-12` +* `Debian-11` +* `Debian` **(default)** _(deprecated, 'Debian-11' is a drop-in replacement, except for the wsl-shell-distribution-wrapper name)_ * `kali-linux` * `openSUSE-Leap-15.2` * `Ubuntu-24.04` @@ -187,8 +197,8 @@ https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configuration-settings-f This can also be used if the distribution is installed already. **WARNING:** Setting this option will overwrite any existing content of the file. -Some distributions like Ubuntu-24.04 might already ship with a wsl.conf file. -Make sure to check whether a file exists by default and whether you want to included +Some distributions like Debian-12+ and Ubuntu-24.04+ ship with a default wsl.conf file. +Make sure to check whether a file exists by default and whether you want to include its contents in your configured value. **Default value:** none diff --git a/src/jsMain/kotlin/net/kautler/github/action/setup_wsl/Distribution.kt b/src/jsMain/kotlin/net/kautler/github/action/setup_wsl/Distribution.kt index cd344eec..1581507b 100644 --- a/src/jsMain/kotlin/net/kautler/github/action/setup_wsl/Distribution.kt +++ b/src/jsMain/kotlin/net/kautler/github/action/setup_wsl/Distribution.kt @@ -16,28 +16,28 @@ package net.kautler.github.action.setup_wsl -import actions.core.debug -import actions.core.isDebug import actions.exec.ExecOptions import actions.exec.exec -import io.ktor.client.HttpClient -import io.ktor.client.engine.js.Js -import io.ktor.client.plugins.UserAgent -import io.ktor.client.request.forms.submitForm -import io.ktor.client.statement.bodyAsText -import io.ktor.http.HttpStatusCode.Companion.OK -import io.ktor.http.parameters import js.objects.recordOf -import kotlinx.coroutines.CoroutineStart.LAZY -import kotlinx.coroutines.DelicateCoroutinesApi -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.async +import net.kautler.github.action.setup_wsl.InstallMethod.APP_BUNDLE +import net.kautler.github.action.setup_wsl.InstallMethod.TARBALL +import net.kautler.github.action.setup_wsl.InstallMethod.WSL_FILE import org.w3c.dom.url.URL import semver.SemVer val distributions = listOf( Alpine, + Alpine317, + Alpine318, + Alpine319, + Alpine320, + Alpine321, + Alpine322, + Alpine323, Debian, + Debian11, + Debian12, + Debian13, Kali, OpenSuseLeap15_2, Ubuntu1604, @@ -47,109 +47,50 @@ val distributions = listOf( Ubuntu2404 ).associateBy { it.userId } +enum class InstallMethod { APP_BUNDLE, TARBALL, WSL_FILE } + sealed class Distribution( val wslId: String, + val userId: String, val distributionName: String, val version: SemVer, - private val _downloadUrl: URL?, - private val productId: String?, - val installerFile: String, - val userId: String = wslId + val downloadUrl: URL, + val installerFile: String? = null ) { - @DelicateCoroutinesApi - val downloadUrl = GlobalScope.async(start = LAZY) { - if (_downloadUrl != null) { - return@async _downloadUrl - } - - val parameters = parameters { - append("type", "ProductId") - append("url", productId!!) - } - - return@async HttpClient(Js) { - install(UserAgent) { - agent = "Setup WSL GitHub Action" - } - }.use { client -> - retry(5) { - val response = client.submitForm( - url = "https://store.rg-adguard.net/api/GetFiles", - formParameters = parameters - ) - - if (response.status != OK) { - if (isDebug()) { - val echoResponse = client.submitForm( - url = "https://echo.free.beeceptor.com/api/GetFiles", - formParameters = parameters - ) - if (echoResponse.status == OK) { - debug("Request:\n${echoResponse.bodyAsText()}") - } else { - debug("Could not get echo response (statusCode: ${echoResponse.status.value} / statusMessage: ${echoResponse.status.description})") - } - - val responseMessage = JSON.stringify( - recordOf( - "httpVersion" to "${response.version}", - "headers" to "${response.headers}", - "method" to "${response.call.request.method}", - "url" to "${response.call.request.url}", - "statusCode" to response.status.value, - "statusMessage" to response.status.description, - "body" to response.bodyAsText() - ), - space = 2 - ) - debug("Response:\n$responseMessage") - } - error("Could not determine download URL (statusCode: ${response.status.value} / statusMessage: ${response.status.description})") - } - - val body = response.bodyAsText() - val downloadLinkAnchorMatch = - """]*href="(?[^"]+)"[^>]*>[^<]*\.appx(?:bundle)?""".toRegex().find(body) - ?: error("Could not determine download URL from:\n$body") - - return@retry URL(downloadLinkAnchorMatch.groups[1]!!.value) - } - } - } - - constructor( - wslId: String, - distributionName: String, - version: SemVer, - downloadUrl: URL, - installerFile: String - ) : this(wslId, distributionName, version, downloadUrl, null, installerFile) - constructor( wslId: String, - userId: String, distributionName: String, version: SemVer, downloadUrl: URL, - installerFile: String, - ) : this(wslId, distributionName, version, downloadUrl, null, installerFile, userId) - - constructor( - wslId: String, - distributionName: String, - version: SemVer, - productId: String, - installerFile: String - ) : this(wslId, distributionName, version, null, productId, installerFile) + installerFile: String? = null + ) : this(wslId, wslId, distributionName, version, downloadUrl, installerFile) + + val downloadFileName = downloadUrl + .pathname + .substringAfterLast('/') + .substringBefore('?') + + val installMethod = when { + installerFile != null -> APP_BUNDLE + downloadFileName.endsWith(".wsl") -> WSL_FILE + downloadFileName.endsWith(".tar.gz") || downloadFileName.endsWith(".tgz") -> TARBALL + else -> error("Unknown install method for download URL '$downloadUrl'") + } - constructor( - wslId: String, - userId: String, - distributionName: String, - version: SemVer, - productId: String, - installerFile: String - ) : this(wslId, distributionName, version, null, productId, installerFile, userId) + open suspend fun createUser(username: String) { + exec( + commandLine = "wsl", + args = arrayOf( + "--distribution", + wslId, + "useradd", + "-m", + "-p", + "4qBD5NWD3IkbU", + username + ) + ) + } abstract suspend fun update() @@ -162,7 +103,7 @@ abstract class AptGetBasedDistribution : Distribution { distributionName: String, version: SemVer, downloadUrl: URL, - installerFile: String + installerFile: String? = null ) : super(wslId, distributionName, version, downloadUrl, installerFile) constructor( @@ -171,26 +112,9 @@ abstract class AptGetBasedDistribution : Distribution { distributionName: String, version: SemVer, downloadUrl: URL, - installerFile: String + installerFile: String? = null ) : super(wslId, userId, distributionName, version, downloadUrl, installerFile) - constructor( - wslId: String, - distributionName: String, - version: SemVer, - productId: String, - installerFile: String - ) : super(wslId, distributionName, version, productId, installerFile) - - constructor( - wslId: String, - userId: String, - distributionName: String, - version: SemVer, - productId: String, - installerFile: String - ) : super(wslId, userId, distributionName, version, productId, installerFile) - protected open suspend fun refresh() { exec( commandLine = "wsl", @@ -262,8 +186,6 @@ object Ubuntu2404 : AptGetBasedDistribution( wslId = "Ubuntu-24.04", distributionName = "Ubuntu", version = SemVer("24.4.0"), - // work-around for missing shortlink on https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions - //downloadUrl = URL("https://aka.ms/wslubuntu2404"), downloadUrl = URL("https://wslstorestorage.blob.core.windows.net/wslblob/Ubuntu2404-240425.AppxBundle"), installerFile = "ubuntu2404.exe" ) @@ -302,13 +224,50 @@ object Ubuntu1604 : AptGetBasedDistribution( installerFile = "ubuntu1604.exe" ) -object Debian : AptGetBasedDistribution( - wslId = "Debian", - distributionName = "Debian", - version = SemVer("1.0.0"), - downloadUrl = URL("https://aka.ms/wsl-debian-gnulinux"), - installerFile = "debian.exe" -) { +abstract class DebianDistribution : AptGetBasedDistribution { + constructor( + wslId: String, + distributionName: String, + version: SemVer, + downloadUrl: URL, + installerFile: String? = null + ) : super(wslId, distributionName, version, downloadUrl, installerFile) + + constructor( + wslId: String, + userId: String, + distributionName: String, + version: SemVer, + downloadUrl: URL, + installerFile: String? = null + ) : super(wslId, userId, distributionName, version, downloadUrl, installerFile) + + override suspend fun update() { + refresh() + retry(5) { + update(false) + } + } +} + +abstract class ArchivedDebianDistribution : DebianDistribution { + constructor( + wslId: String, + distributionName: String, + version: SemVer, + downloadUrl: URL, + installerFile: String? = null + ) : super(wslId, distributionName, version, downloadUrl, installerFile) + + constructor( + wslId: String, + userId: String, + distributionName: String, + version: SemVer, + downloadUrl: URL, + installerFile: String? = null + ) : super(wslId, userId, distributionName, version, downloadUrl, installerFile) + override suspend fun refresh() { exec( commandLine = "wsl", @@ -323,15 +282,39 @@ object Debian : AptGetBasedDistribution( ) super.refresh() } - - override suspend fun update() { - refresh() - retry(5) { - update(false) - } - } } +object Debian : ArchivedDebianDistribution( + wslId = "Debian", + distributionName = "Debian", + version = SemVer("1.0.0"), + downloadUrl = URL("https://aka.ms/wsl-debian-gnulinux"), + installerFile = "debian.exe" +) + +object Debian11 : ArchivedDebianDistribution( + wslId = "Debian", + userId = "Debian-11", + distributionName = "Debian", + version = SemVer("1.0.0"), + downloadUrl = URL("https://aka.ms/wsl-debian-gnulinux"), + installerFile = "debian.exe" +) + +object Debian12 : DebianDistribution( + wslId = "Debian-12", + distributionName = "Debian", + version = SemVer("1.20.0"), + downloadUrl = URL("https://salsa.debian.org/debian/WSL/-/jobs/7130915/artifacts/raw/Debian_WSL_AMD64_v1.20.0.0.wsl") +) + +object Debian13 : DebianDistribution( + wslId = "Debian-13", + distributionName = "Debian", + version = SemVer("1.24.0"), + downloadUrl = URL("https://salsa.debian.org/debian/WSL/-/jobs/9229125/artifacts/raw/Debian_WSL_AMD64_v1.24.0.0.wsl") +) + object Kali : AptGetBasedDistribution( wslId = "MyDistribution", userId = "kali-linux", @@ -368,7 +351,7 @@ abstract class ZypperBasedDistribution : Distribution { distributionName: String, version: SemVer, downloadUrl: URL, - installerFile: String + installerFile: String? = null ) : super(wslId, distributionName, version, downloadUrl, installerFile) constructor( @@ -377,26 +360,9 @@ abstract class ZypperBasedDistribution : Distribution { distributionName: String, version: SemVer, downloadUrl: URL, - installerFile: String + installerFile: String? = null ) : super(wslId, userId, distributionName, version, downloadUrl, installerFile) - constructor( - wslId: String, - distributionName: String, - version: SemVer, - productId: String, - installerFile: String - ) : super(wslId, distributionName, version, productId, installerFile) - - constructor( - wslId: String, - userId: String, - distributionName: String, - version: SemVer, - productId: String, - installerFile: String - ) : super(wslId, userId, distributionName, version, productId, installerFile) - protected open suspend fun refresh() { exec( commandLine = "wsl", @@ -460,7 +426,7 @@ abstract class ApkBasedDistribution : Distribution { distributionName: String, version: SemVer, downloadUrl: URL, - installerFile: String + installerFile: String? = null ) : super(wslId, distributionName, version, downloadUrl, installerFile) constructor( @@ -469,26 +435,9 @@ abstract class ApkBasedDistribution : Distribution { distributionName: String, version: SemVer, downloadUrl: URL, - installerFile: String + installerFile: String? = null ) : super(wslId, userId, distributionName, version, downloadUrl, installerFile) - constructor( - wslId: String, - distributionName: String, - version: SemVer, - productId: String, - installerFile: String - ) : super(wslId, distributionName, version, productId, installerFile) - - constructor( - wslId: String, - userId: String, - distributionName: String, - version: SemVer, - productId: String, - installerFile: String - ) : super(wslId, userId, distributionName, version, productId, installerFile) - private suspend fun refresh() { exec( commandLine = "wsl", @@ -529,10 +478,93 @@ abstract class ApkBasedDistribution : Distribution { } } -object Alpine : ApkBasedDistribution( +abstract class AlpineDistribution : ApkBasedDistribution { + constructor( + wslId: String, + distributionName: String, + version: SemVer, + downloadUrl: URL, + installerFile: String? = null + ) : super(wslId, distributionName, version, downloadUrl, installerFile) + + constructor( + wslId: String, + userId: String, + distributionName: String, + version: SemVer, + downloadUrl: URL, + installerFile: String? = null + ) : super(wslId, userId, distributionName, version, downloadUrl, installerFile) + + override suspend fun createUser(username: String) { + // Alpine minirootfs does not include the shadow package, so useradd is not available. + // Use BusyBox adduser instead. + exec( + commandLine = "wsl", + args = arrayOf( + "--distribution", + wslId, + "adduser", + "-D", + username + ) + ) + } +} + +object Alpine : AlpineDistribution( + wslId = "Alpine", + distributionName = "Alpine", + version = SemVer("3.17.10"), + downloadUrl = URL("https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/alpine-minirootfs-3.17.10-x86_64.tar.gz") +) + +object Alpine317 : AlpineDistribution( wslId = "Alpine", + userId = "Alpine-3.17", + distributionName = "Alpine", + version = SemVer("3.17.10"), + downloadUrl = URL("https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/alpine-minirootfs-3.17.10-x86_64.tar.gz") +) + +object Alpine318 : AlpineDistribution( + wslId = "Alpine-3.18", + distributionName = "Alpine", + version = SemVer("3.18.12"), + downloadUrl = URL("https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/x86_64/alpine-minirootfs-3.18.12-x86_64.tar.gz") +) + +object Alpine319 : AlpineDistribution( + wslId = "Alpine-3.19", + distributionName = "Alpine", + version = SemVer("3.19.9"), + downloadUrl = URL("https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-minirootfs-3.19.9-x86_64.tar.gz") +) + +object Alpine320 : AlpineDistribution( + wslId = "Alpine-3.20", + distributionName = "Alpine", + version = SemVer("3.20.9"), + downloadUrl = URL("https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-minirootfs-3.20.9-x86_64.tar.gz"), +) + +object Alpine321 : AlpineDistribution( + wslId = "Alpine-3.21", + distributionName = "Alpine", + version = SemVer("3.21.6"), + downloadUrl = URL("https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/x86_64/alpine-minirootfs-3.21.6-x86_64.tar.gz"), +) + +object Alpine322 : AlpineDistribution( + wslId = "Alpine-3.22", + distributionName = "Alpine", + version = SemVer("3.22.3"), + downloadUrl = URL("https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/x86_64/alpine-minirootfs-3.22.3-x86_64.tar.gz"), +) + +object Alpine323 : AlpineDistribution( + wslId = "Alpine-3.23", distributionName = "Alpine", - version = SemVer("1.0.3"), - productId = "9p804crf0395", - installerFile = "Alpine.exe" + version = SemVer("3.23.3"), + downloadUrl = URL("https://dl-cdn.alpinelinux.org/alpine/v3.23/releases/x86_64/alpine-minirootfs-3.23.3-x86_64.tar.gz"), ) diff --git a/src/jsMain/kotlin/net/kautler/github/action/setup_wsl/SetupWsl.kt b/src/jsMain/kotlin/net/kautler/github/action/setup_wsl/SetupWsl.kt index b9c9e8cc..d7c7b7f3 100644 --- a/src/jsMain/kotlin/net/kautler/github/action/setup_wsl/SetupWsl.kt +++ b/src/jsMain/kotlin/net/kautler/github/action/setup_wsl/SetupWsl.kt @@ -39,6 +39,7 @@ import actions.io.mkdirP import actions.io.mv import actions.io.which import actions.tool.cache.cacheDir +import actions.tool.cache.cacheFile import actions.tool.cache.downloadTool import actions.tool.cache.find import kotlinx.coroutines.CoroutineStart.LAZY @@ -52,6 +53,9 @@ import kotlinx.coroutines.flow.firstOrNull import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.onStart +import net.kautler.github.action.setup_wsl.InstallMethod.APP_BUNDLE +import net.kautler.github.action.setup_wsl.InstallMethod.TARBALL +import net.kautler.github.action.setup_wsl.InstallMethod.WSL_FILE import node.buffer.Buffer import node.buffer.BufferEncoding import node.buffer.utf16le @@ -107,8 +111,29 @@ val wslHelp = GlobalScope.async(start = LAZY) { val distribution by lazy { val distributionId = getInput("distribution", InputOptions(required = true)) + val distribution = distributions[distributionId] + + when (distribution) { + Alpine -> warning( + """ + 'Alpine' distribution is deprecated. + Please migrate to a versioned distribution such as 'Alpine-3.23'. + 'Alpine-3.17' is a drop-in replacement, except for the wsl-shell-distribution-wrapper name. + """.trimIndent() + ) + + Debian -> warning( + """ + 'Debian' distribution is deprecated. + Please migrate to a versioned distribution such as 'Debian-13'. + 'Debian-11' is a drop-in replacement, except for the wsl-shell-distribution-wrapper name. + """.trimIndent() + ) - return@lazy requireNotNull(distributions[distributionId]) { + else -> Unit + } + + return@lazy requireNotNull(distribution) { "'${distributionId}' is not a valid distribution. Valid values: ${ distributions.keys.sortedWith(String.CASE_INSENSITIVE_ORDER).joinToString() }" @@ -182,30 +207,49 @@ val distributionDirectory = GlobalScope.async(start = LAZY) { val cacheKey = "2:distributionDirectory_${distribution.distributionName}_${distribution.version}" + val installerFile = when (distribution.installMethod) { + TARBALL, WSL_FILE -> distribution.downloadFileName + APP_BUNDLE -> distribution.installerFile!! + } + val restoredKey = if (useCache) restoreCache(arrayOf(cacheDirectory), cacheKey) else null if (restoredKey != null) { - if (exists(path.join(cacheDirectory, distribution.installerFile))) { + if (exists(path.join(cacheDirectory, installerFile))) { return@async cacheDirectory } } - val distributionDownload = downloadTool("${distribution.downloadUrl()}") - var extractedDistributionDirectory = extractZip(distributionDownload) + val distributionDownload = downloadTool("${distribution.downloadUrl}") - if (!exists(path.join(extractedDistributionDirectory, distribution.installerFile))) { - extractedDistributionDirectory = readdir(extractedDistributionDirectory) - .asFlow() - .filter { it.contains("""(? { + cacheDirectory = cacheFile( + distributionDownload, + installerFile, + distribution.distributionName, + "${distribution.version}" + ) + } - cacheDirectory = cacheDir( - extractedDistributionDirectory, - distribution.distributionName, - "${distribution.version}" - ) + APP_BUNDLE -> { + var extractedDistributionDirectory = extractZip(distributionDownload) + + if (!exists(path.join(extractedDistributionDirectory, installerFile))) { + extractedDistributionDirectory = readdir(extractedDistributionDirectory) + .asFlow() + .filter { it.contains("""(? distribution.downloadFileName + APP_BUNDLE -> distribution.installerFile!! + } ) + + when (distribution.installMethod) { + WSL_FILE if (wslHelp().contains("--from-file")) -> { + exec( + commandLine = "wsl", + args = arrayOf( + "--install", + "--from-file", + installerFile, + // skip the OOBE script that prompts for interactive user creation + "--no-launch", + "--name", + distribution.wslId + ) + ) + } + + TARBALL, WSL_FILE -> { + val installLocation = path.join(wslInstallationsDirectory, distribution.wslId) + mkdirP(installLocation) + exec( + commandLine = "wsl", + args = arrayOf( + "--import", + distribution.wslId, + installLocation, + installerFile + ) + ) + } + + APP_BUNDLE -> { + exec( + commandLine = """"$installerFile"""", + args = arrayOf("install", "--root"), + options = ExecOptions(input = Buffer.from("")) + ) + } + } } suspend fun waitForWslStatusNotContaining( @@ -474,18 +561,7 @@ suspend fun writeWslShellWrapper() { options = ExecOptions(ignoreReturnCode = true) ) == 0 if (!wslShellUserExists) { - exec( - commandLine = "wsl", - args = arrayOf( - "--distribution", - wslId(), - "useradd", - "-m", - "-p", - "4qBD5NWD3IkbU", - wslShellUser - ) - ) + distribution.createUser(wslShellUser) } }