1010 strategy :
1111 fail-fast : false
1212 matrix :
13- os : [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest]
13+ os : [ubuntu-latest, ubuntu-arm, alpine-latest, macos-intel, macos-arm, windows-latest]
1414 include :
1515 - os : ubuntu-latest
1616 out-file : libtemporal_sdk_bridge.so
2525 # We use the Python manylinux image for glibc compatibility
2626 container : quay.io/pypa/manylinux2014_aarch64
2727 protobuf-url : https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-aarch_64.zip
28+ - os : alpine-latest
29+ out-file : libtemporal_sdk_bridge.so
30+ out-prefix : linux-musl-x64
31+ # Need Alpine container since GH runner doesn't have one
32+ container : mcr.microsoft.com/dotnet/sdk:8.0-alpine
33+ protobuf-url : https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip
34+ runsOn : ubuntu-latest
2835 - os : macos-intel
2936 out-file : libtemporal_sdk_bridge.dylib
3037 out-prefix : osx-x64
6875 if : ${{ !matrix.container }}
6976 run : cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release
7077
71- - name : Build (Docker)
72- if : ${{ matrix.container }}
78+ - name : Build (Docker non-Alpine )
79+ if : ${{ matrix.container && matrix.os != 'alpine-latest' }}
7380 run : |
7481 docker run --rm -v "$(pwd):/workspace" -w /workspace \
7582 ${{ matrix.container }} \
@@ -82,11 +89,27 @@ jobs:
8289 && cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release \
8390 '
8491
92+ - name : Build (Docker Alpine)
93+ if : ${{ matrix.container && matrix.os == 'alpine-latest' }}
94+ run : |
95+ docker run --rm -v "$(pwd):/workspace" -w /workspace \
96+ ${{ matrix.container }} \
97+ sh -c ' \
98+ curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y \
99+ && . $HOME/.cargo/env \
100+ && apk add --no-cache build-base \
101+ && curl -LO ${{ matrix.protobuf-url }} \
102+ && unzip protoc-*.zip -d /usr/local/protobuf \
103+ && export PATH="$PATH:/usr/local/protobuf/bin" \
104+ && RUSTFLAGS="-C target-feature=-crt-static" cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release \
105+ '
106+
85107 - name : Upload bridge library
86108 uses : actions/upload-artifact@v4
87109 with :
88110 name : ${{ matrix.out-prefix }}-bridge
89111 path : src/Temporalio/Bridge/target/release/${{ matrix.out-file }}
112+ if-no-files-found : error
90113
91114 build-nuget-package :
92115 needs :
@@ -129,15 +152,19 @@ jobs:
129152 strategy :
130153 fail-fast : false
131154 matrix :
132- os : [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest]
155+ os : [ubuntu-latest, ubuntu-arm, alpine-latest, macos-intel, macos-arm, windows-latest]
133156 include :
134157 - os : ubuntu-arm
135158 runsOn : buildjet-4vcpu-ubuntu-2204-arm
159+ - os : alpine-latest
160+ container : mcr.microsoft.com/dotnet/sdk:6.0-alpine
161+ runsOn : ubuntu-latest
136162 - os : macos-intel
137163 runsOn : macos-13
138164 - os : macos-arm
139165 runsOn : macos-14
140166 runs-on : ${{ matrix.runsOn || matrix.os }}
167+ container : ${{ matrix.container }}
141168 steps :
142169 - name : Checkout repository
143170 uses : actions/checkout@v4
@@ -148,18 +175,30 @@ jobs:
148175 uses : actions/download-artifact@v4
149176 with :
150177 name : nuget-package
151- path : nuget-package
178+ path : ${{ github.workspace }}/ nuget-package
152179
153- - name : Setup .NET
180+ - name : Setup .NET (non-Alpine)
154181 uses : actions/setup-dotnet@v4
182+ if : ${{ matrix.os != 'alpine-latest' }}
155183 with :
156184 # Specific .NET version required because GitHub macos ARM image has
157185 # bad pre-installed .NET version
158186 dotnet-version : 6.x
159187
160- - name : Run smoke test
188+ - name : Setup .NET (Alpine)
189+ if : ${{ matrix.os == 'alpine-latest' }}
190+ run : apk add dotnet6-sdk
191+
192+ - name : Run smoke test (non-Windows)
193+ if : ${{ matrix.os != 'windows-latest' }}
194+ run : |
195+ dotnet add tests/Temporalio.SmokeTest package Temporalio -s "$GITHUB_WORKSPACE/nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease
196+ dotnet run --project tests/Temporalio.SmokeTest
197+
198+ - name : Run smoke test (Windows)
199+ if : ${{ matrix.os == 'windows-latest' }}
161200 run : |
162- dotnet add tests/Temporalio.SmokeTest package Temporalio -s "${{ github.workspace }} /nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease
201+ dotnet add tests/Temporalio.SmokeTest package Temporalio -s "$env:GITHUB_WORKSPACE /nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease
163202 dotnet run --project tests/Temporalio.SmokeTest
164203
165204 - name : Setup msbuild (Windows only)
@@ -169,6 +208,6 @@ jobs:
169208 - name : Run .NET framework smoke test (Windows only)
170209 if : ${{ matrix.os == 'windows-latest' }}
171210 run : |
172- dotnet add tests/Temporalio.SmokeTestDotNetFramework package Temporalio -s "${{ github.workspace }} /nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease
211+ dotnet add tests/Temporalio.SmokeTestDotNetFramework package Temporalio -s "$env:GITHUB_WORKSPACE /nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease
173212 msbuild tests/Temporalio.SmokeTestDotNetFramework -t:restore,build -p:Platform=x64
174213 tests/Temporalio.SmokeTestDotNetFramework/bin/x64/Debug/Temporalio.SmokeTestDotNetFramework.exe
0 commit comments