Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
vicamo committed Feb 3, 2025
1 parent cbbdfb1 commit 33b7f2f
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,36 @@ jobs:
runs-on: ubuntu-latest
outputs:
codenames: ${{ steps.processing.outputs.codenames }}
env:
DEBIAN_ARCHES: |
[
["amd64", "linux/amd64"],
["arm", "linux/arm"],
["arm64", "linux/arm64"],
["armel", "linux/arm/v5"],
["armhf", "linux/arm/v7"],
["i386", "linux/386"],
["loong64", "linux/loong64"],
["lpia", "linux/386/lpia"],
["mips64el", "linux/mips64le"],
["ppc64el", "linux/ppc64le"],
["riscv64", "linux/riscv64"],
["s390x", "linux/s390x"],
["mips", "linux/mips"],
["mipsel", "linux/mipsle"],
["powerpc", "linux/ppc"],
["ppc64", "linux/ppc64"],
["s390", "linux/s390"],
["sparc", "linux/sparc"],
["sparc64", "linux/sparc64"],
["x32", "linux/amd64p32"],
["alpha", "linux/alpha"],
["hppa", "linux/hppa"],
["m68k", "linux/m68k"],
["sh4", "linux/sh4"]
]
steps:
- name: Debian Releases Info
id: debian
Expand All @@ -47,34 +77,6 @@ jobs:
DEBIAN_JSON: ${{ steps.debian.outputs.json }}
UBUNTU_JSON: ${{ steps.ubuntu.outputs.json }}
run: |
debian_archs='[
["amd64", "linux/amd64"],
["arm", "linux/arm"],
["arm64", "linux/arm64"],
["armel", "linux/arm/v5"],
["armhf", "linux/arm/v7"],
["i386", "linux/386"],
["loong64", "linux/loong64"],
["lpia", "linux/386/lpia"],
["mips64el", "linux/mips64le"],
["ppc64el", "linux/ppc64le"],
["riscv64", "linux/riscv64"],
["s390x", "linux/s390x"],
["mips", "linux/mips"],
["mipsel", "linux/mipsle"],
["powerpc", "linux/ppc"],
["ppc64", "linux/ppc64"],
["s390", "linux/s390"],
["sparc", "linux/sparc"],
["sparc64", "linux/sparc64"],
["x32", "linux/amd64p32"],
["alpha", "linux/alpha"],
["hppa", "linux/hppa"],
["m68k", "linux/m68k"],
["sh4", "linux/sh4"]
]'
disabled_codename='[
"experimental",
"hamm",
Expand Down Expand Up @@ -105,7 +107,7 @@ jobs:
map({
"arch":.,
"platform":(. as $arch |
'"${debian_archs}"' |
'"${DEBIAN_ARCHES}"' |
map(select(.[0] == $arch))[0][1]),
}) |
tostring)
Expand Down Expand Up @@ -138,20 +140,17 @@ jobs:
{
"distribution":$s.distribution,
"codename":$s.codename,
"platforms":(
"architectures":(
$s.architectures |
map(select(. as $arch |
'"${disabled_arches}"' |
map(select((.[0] == $s.codename or .[0] == "any")
and (.[1] | map(select( . == $arch or . == "any")) | length > 0)
and (.[2] == "unavailable"))) |
length > 0)) |
map(. as $arch |
'"${debian_archs}"' |
map(select(.[0] == $arch))[0][1])
length > 0))
)
}) |
map(select(.platforms | length > 0))
map(select(.architectures | length > 0))
')"
codenames="$(echo "${codenames}" |
Expand Down Expand Up @@ -199,7 +198,7 @@ jobs:
echo "${available}" | jq
echo "::endgroup::"
unavailables="$(echo "${CODENAMES}" |
unbuildables="$(echo "${CODENAMES}" |
jq -c -M 'map(. as $s | {
"codename":$s.codename,
"platforms": (
Expand All @@ -209,28 +208,29 @@ jobs:
)
}) |
map(select(.platforms | length > 0))')"
if [ "${unavailables}" != "[]" ]; then
if [ "${unbuildables}" != "[]" ]; then
echo "::group::Images unavalble at present but are to be built"
echo "${unavailables}" | jq
echo "${unbuildables}" | jq
echo "::endgroup::"
fi
missing="$(echo "${UNAVAILABLES}" |
buildables="$(echo "${UNAVAILABLES}" |
jq -c -M 'map(. as $s | {
"codename":$s.codename,
"platforms": (
"architectures": (
($s.architectures | map(. as $arch | '"${DEBIAN_ARCHES}"' | map(select(. == $arch))[0][1])) as $platforms |
('"${available}"' | map(select(.image == ($s.distribution + ":" + $s.codename))) | map(.platforms[])) as $available |
$s.platforms - ($s.platforms - $available)
$platforms - ($platforms - $available)
)
}) |
map(select(.platforms | length > 0))')"
if [ "${missing}" != "[]" ]; then
map(select(.architectures | length > 0))')"
if [ "${buildables}" != "[]" ]; then
echo "::group::Images skipped due to unavailability but are avalble now"
echo "${missing}" | jq
echo "${buildables}" | jq
echo "::endgroup::"
fi
[ "${unavailables}" == "[]" ] && [ "${missing}" == "[]" ] || exit 1
[ "${unbuildables}" == "[]" ] && [ "${buildables}" == "[]" ] || exit 1
build:
needs: generate-jobs
Expand Down

0 comments on commit 33b7f2f

Please sign in to comment.