3636 platforms :
3737 description : ' Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
3838 required : true
39- default : ' linux-x64, linux-x86-hs, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
39+ default : ' linux-x64, linux-x86-hs, linux-x64-variants, linux-cross-compile, alpine-linux-x64, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
4040 configure-arguments :
4141 description : ' Additional configure arguments'
4242 required : false
@@ -57,11 +57,15 @@ jobs:
5757 select :
5858 name : ' Select platforms'
5959 runs-on : ubuntu-22.04
60+ env :
61+ # List of platforms to exclude by default
62+ EXCLUDED_PLATFORMS : ' alpine-linux-x64'
6063 outputs :
6164 linux-x64 : ${{ steps.include.outputs.linux-x64 }}
6265 linux-x86-hs : ${{ steps.include.outputs.linux-x86-hs }}
6366 linux-x64-variants : ${{ steps.include.outputs.linux-x64-variants }}
6467 linux-cross-compile : ${{ steps.include.outputs.linux-cross-compile }}
68+ alpine-linux-x64 : ${{ steps.include.outputs.alpine-linux-x64 }}
6569 macos-x64 : ${{ steps.include.outputs.macos-x64 }}
6670 macos-aarch64 : ${{ steps.include.outputs.macos-aarch64 }}
6771 windows-x64 : ${{ steps.include.outputs.windows-x64 }}
7882 # Returns 'true' if the input platform list matches any of the platform monikers given as argument,
7983 # 'false' otherwise.
8084 # arg $1: platform name or names to look for
85+
86+ # Convert EXCLUDED_PLATFORMS from a comma-separated string to an array
87+ IFS=',' read -r -a excluded_array <<< "$EXCLUDED_PLATFORMS"
88+
8189 function check_platform() {
8290 if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
8391 input='${{ github.event.inputs.platforms }}'
@@ -94,7 +102,13 @@ jobs:
94102
95103 normalized_input="$(echo ,$input, | tr -d ' ')"
96104 if [[ "$normalized_input" == ",," ]]; then
97- # For an empty input, assume all platforms should run
105+ # For an empty input, assume all platforms should run, except those in the EXCLUDED_PLATFORMS list
106+ for excluded in "${excluded_array[@]}"; do
107+ if [[ "$1" == "$excluded" ]]; then
108+ echo 'false'
109+ return
110+ fi
111+ done
98112 echo 'true'
99113 return
100114 else
@@ -105,6 +119,14 @@ jobs:
105119 return
106120 fi
107121 done
122+
123+ # If not explicitly included, check against the EXCLUDED_PLATFORMS list
124+ for excluded in "${excluded_array[@]}"; do
125+ if [[ "$1" == "$excluded" ]]; then
126+ echo 'false'
127+ return
128+ fi
129+ done
108130 fi
109131
110132 echo 'false'
@@ -114,6 +136,7 @@ jobs:
114136 echo "linux-x86-hs=$(check_platform linux-x86-hs linux x86)" >> $GITHUB_OUTPUT
115137 echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
116138 echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
139+ echo "alpine-linux-x64=$(check_platform alpine-linux-x64 alpine-linux x64)" >> $GITHUB_OUTPUT
117140 echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
118141 echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
119142 echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
@@ -221,6 +244,16 @@ jobs:
221244 make-arguments : ${{ github.event.inputs.make-arguments }}
222245 if : needs.select.outputs.linux-cross-compile == 'true'
223246
247+ build-alpine-linux-x64 :
248+ name : alpine-linux-x64
249+ needs : select
250+ uses : ./.github/workflows/build-alpine-linux.yml
251+ with :
252+ platform : alpine-linux-x64
253+ configure-arguments : ${{ github.event.inputs.configure-arguments }}
254+ make-arguments : ${{ github.event.inputs.make-arguments }}
255+ if : needs.select.outputs.alpine-linux-x64 == 'true'
256+
224257 build-macos-x64 :
225258 name : macos-x64
226259 needs : select
@@ -344,6 +377,7 @@ jobs:
344377 - build-linux-x64-hs-minimal
345378 - build-linux-x64-hs-optimized
346379 - build-linux-cross-compile
380+ - build-alpine-linux-x64
347381 - build-macos-x64
348382 - build-macos-aarch64
349383 - build-windows-x64
0 commit comments