Skip to content

Commit 57e53fe

Browse files
authored
Merge pull request MonoMod#218 from nike4613/linux-musl
Add linux-musl to our test matrix
2 parents 09f3a5f + 8fb294d commit 57e53fe

4 files changed

Lines changed: 52 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ jobs:
119119
env:
120120
GH_TOKEN: ${{ github.token }}
121121
run: |
122+
$sha = '${{ github.event.pull_request.head.sha }}';
123+
if (-not $sha) { $sha = '${{ github.sha }}'; }
122124
$workflow = gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" `
123-
"/repos/${{ github.repository }}/actions/runs?head_sha=${{ github.sha }}" `
125+
"/repos/${{ github.repository }}/actions/runs?head_sha=$sha" `
124126
| ConvertFrom-Json `
125127
| % { $_.workflow_runs } `
126128
| Where { $_.path -eq ".github/workflows/containers.yml" }
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM alpine:3.21
2+
3+
# First, packages
4+
RUN apk update \
5+
&& apk upgrade --no-cache \
6+
&& apk add --no-cache \
7+
-X https://dl-cdn.alpinelinux.org/alpine/edge/main \
8+
-X https://dl-cdn.alpinelinux.org/alpine/edge/community \
9+
-X https://dl-cdn.alpinelinux.org/alpine/edge/testing \
10+
git git-lfs curl wget bash nodejs lttng-ust openssh-client tar \
11+
mono dotnet9-runtime \
12+
# Dependencies for older runtimes
13+
&& apk add --no-cache -X https://dl-cdn.alpinelinux.org/alpine/v3.18/community \
14+
libssl1.1 \
15+
&& apk cache purge
16+
17+
# Then, powershell
18+
RUN curl -L \
19+
https://github.com/PowerShell/PowerShell/releases/download/v7.5.0/powershell-7.5.0-linux-musl-x64.tar.gz \
20+
-o /tmp/powershell.tar.gz \
21+
&& mkdir -p /opt/powershell \
22+
&& tar xzf /tmp/powershell.tar.gz -C /opt/powershell \
23+
&& chmod +x /opt/powershell/pwsh \
24+
&& ln -s /opt/powershell/pwsh /usr/bin/pwsh \
25+
&& rm /tmp/powershell.tar.gz
26+
27+
# Older runtimes can't find a valid libicu, and we don't particularly care about globalization anyway
28+
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

build/gen-test-matrix/Models/Dotnet.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ internal sealed record Dotnet : Enableable
6767
Name = ".NET 5.0",
6868
Sdk = "5.0",
6969
TFM = "net5.0",
70-
RIDs = ["win-x86", "win-x64", "linux-x64", "osx-x64"]
70+
RIDs = ["win-x86", "win-x64", "linux-x64", "linux-musl-x64", "osx-x64"]
7171
},
7272
new()
7373
{
@@ -78,7 +78,7 @@ internal sealed record Dotnet : Enableable
7878
MonoPackageSource = Constants.NuGetSource.NugetOrg,
7979
MonoPackageVersion = "6.0.31",
8080

81-
RIDs = ["win-x86", "win-x64", "win-arm64", "linux-x64", "linux-arm", "linux-arm64", "osx-x64", "osx-arm64"]
81+
RIDs = ["win-x86", "win-x64", "win-arm64", "linux-x64", "linux-arm", "linux-arm64", "linux-musl-x64", "linux-musl-arm", "linux-musl-arm64", "osx-x64", "osx-arm64"]
8282
},
8383
new()
8484
{
@@ -89,7 +89,7 @@ internal sealed record Dotnet : Enableable
8989
MonoPackageSource = Constants.NuGetSource.NugetOrg,
9090
MonoPackageVersion = "7.0.20",
9191

92-
RIDs = ["win-x86", "win-x64", "win-arm64", "linux-x64", "linux-arm", "linux-arm64", "osx-x64", "osx-arm64"]
92+
RIDs = ["win-x86", "win-x64", "win-arm64", "linux-x64", "linux-arm", "linux-arm64", "linux-musl-x64", "linux-musl-arm", "linux-musl-arm64", "osx-x64", "osx-arm64"]
9393
},
9494
new()
9595
{
@@ -100,7 +100,7 @@ internal sealed record Dotnet : Enableable
100100
MonoPackageSource = Constants.NuGetSource.NugetOrg,
101101
MonoPackageVersion = "8.0.6",
102102

103-
RIDs = ["win-x86", "win-x64", "win-arm64", "linux-x64", "linux-arm", "linux-arm64", "osx-x64", "osx-arm64"]
103+
RIDs = ["win-x86", "win-x64", "win-arm64", "linux-x64", "linux-arm", "linux-arm64", "linux-musl-x64", "linux-musl-arm", "linux-musl-arm64", "osx-x64", "osx-arm64"]
104104
},
105105
new()
106106
{
@@ -111,7 +111,7 @@ internal sealed record Dotnet : Enableable
111111
MonoPackageSource = Constants.NuGetSource.NugetOrg,
112112
MonoPackageVersion = "9.0.0",
113113

114-
RIDs = ["win-x86", "win-x64", "win-arm64", "linux-x64", "linux-arm", "linux-arm64", "osx-x64", "osx-arm64"]
114+
RIDs = ["win-x86", "win-x64", "win-arm64", "linux-x64", "linux-arm", "linux-arm64", "linux-musl-x64", "linux-musl-arm", "linux-musl-arm64", "osx-x64", "osx-arm64"]
115115
}
116116
];
117117
}

build/gen-test-matrix/Models/OS.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,22 @@ internal sealed record OS : Enableable
6161
]
6262
},
6363
new()
64+
{
65+
Name = "Linux musl",
66+
Runner = "ubuntu-latest",
67+
UseContainer = true,
68+
HasSystemMono = true,
69+
RidName = "linux-musl",
70+
UnityDllName = "monobdwgc-2.0", // TODO: is this correct?
71+
DllPrefix = "lib",
72+
DllSuffix = ".so",
73+
74+
Arch = [
75+
new() { RidName = "x64", UnityName = "linux64", IsRunnerArch = true },
76+
new() { RidName = "arm64", UnityName = null, Enabled = false }, // Linux supports ARM64, but 1. we don't, and 2. Actions doesn't
77+
]
78+
},
79+
new()
6480
{
6581
Name = "MacOS 13",
6682
Runner = "macos-13",

0 commit comments

Comments
 (0)