Skip to content

Commit

Permalink
Merge pull request #174 from crazy-max/alpine-321
Browse files Browse the repository at this point in the history
ci: update alpine to 3.21
  • Loading branch information
crazy-max authored Dec 9, 2024
2 parents ddc255f + e6955cb commit b0cde9e
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ jobs:
fail-fast: false
matrix:
include:
-
image: alpine:3.16
typ: alpine
allow-failure: false
-
image: alpine:3.17
typ: alpine
Expand All @@ -55,6 +51,10 @@ jobs:
image: alpine:3.20
typ: alpine
allow-failure: false
-
image: alpine:3.21
typ: alpine
allow-failure: false
-
image: alpine:edge
typ: alpine
Expand Down
4 changes: 2 additions & 2 deletions src/test-apk.bats
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ load 'assert'
assert_output "$(xx-info alpine-arch)"
run xx-apk add --no-cache zlib
assert_success
[ -f "/$(xx-info)/lib/libz.so.1" ]
[ -f "/$(xx-info)/lib/libz.so.1" ] || [ -f "/$(xx-info)/usr/lib/libz.so.1" ]
run xx-apk del zlib
assert_success
[ ! -f "/$(xx-info)/lib/libz.so.1" ]
[ ! -f "/$(xx-info)/lib/libz.so.1" ] && [ ! -f "/$(xx-info)/usr/lib/libz.so.1" ]
run xx-apk clean
assert_success
[ ! -d "/$(xx-info)" ]
Expand Down
50 changes: 50 additions & 0 deletions src/test-go.bats
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ testEnv() {
export TARGETOS=darwin
export TARGETARCH=amd64
testEnv
unset TARGETOS
}

@test "darwin-arm64-env" {
Expand All @@ -235,6 +236,30 @@ testEnv() {
unset TARGETOS
}

@test "windows-386-env" {
export TARGETOS=windows
export TARGETARCH=386
testEnv
unset TARGETOS
}

@test "windows-amd64-env" {
export TARGETOS=windows
export TARGETARCH=amd64
testEnv
unset TARGETOS
}

@test "windows-arm64-env" {
if ! supportWindowsArm64Go; then
skip "Windows ARM64 not supported"
fi
export TARGETOS=windows
export TARGETARCH=arm64
testEnv
unset TARGETOS
}

testHelloGO() {
run xx-go build -o /tmp/a.out ./fixtures/hello.go
assert_success
Expand Down Expand Up @@ -346,6 +371,31 @@ testHelloGO() {
export TARGETARCH=amd64
export TARGETOS=darwin
testHelloGO
unset TARGETOS
}

@test "windows-386-hellogo" {
export TARGETARCH=386
export TARGETOS=windows
testHelloGO
unset TARGETOS
}

@test "windows-amd64-hellogo" {
export TARGETARCH=amd64
export TARGETOS=windows
testHelloGO
unset TARGETOS
}

@test "windows-arm64-hellogo" {
if ! supportWindowsArm64Go; then
skip "Windows ARM64 not supported"
fi
export TARGETARCH=arm64
export TARGETOS=windows
testHelloGO
unset TARGETOS
}

testHelloCGO() {
Expand Down
15 changes: 15 additions & 0 deletions src/test-verify.bats
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ load 'assert'
run xx-verify /idontexist
assert_failure

export XX_VERIFY_FILE_CMD_OUTPUT=": PE32+ executable (console) ARM64 (stripped to external PDB), for MS Windows"
export TARGETPLATFORM=windows/arm64
run xx-verify /idontexist
assert_success

export XX_VERIFY_FILE_CMD_OUTPUT=": PE32+ executable (console) Aarch64 (stripped to external PDB), for MS Windows"
export TARGETPLATFORM=windows/arm64
run xx-verify /idontexist
Expand All @@ -147,6 +152,11 @@ load 'assert'
run xx-verify /idontexist
assert_failure

export XX_VERIFY_FILE_CMD_OUTPUT=": PE32 executable (console) Intel i386 (stripped to external PDB), for MS Windows"
export TARGETPLATFORM=windows/386
run xx-verify /idontexist
assert_success

export XX_VERIFY_FILE_CMD_OUTPUT=": PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows"
export TARGETPLATFORM=windows/386
run xx-verify /idontexist
Expand Down Expand Up @@ -208,6 +218,11 @@ load 'assert'
run xx-verify /idontexist
assert_failure

export XX_VERIFY_FILE_CMD_OUTPUT=": ELF 32-bit LSB executable, Intel i386, version 1 (SYSV), statically linked, Go BuildID=GUb5psm2_Qmc_LlEF7GP/wcIHIg_4MjQh8NC5wfep/LSmTmWKKZ5smuAQbfeFE/FBYRjFmbJQpV--JKtz4i, not stripped"
export TARGETPLATFORM=linux/386
run xx-verify /idontexist
assert_success

export XX_VERIFY_FILE_CMD_OUTPUT=": ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, Go BuildID=GUb5psm2_Qmc_LlEF7GP/wcIHIg_4MjQh8NC5wfep/LSmTmWKKZ5smuAQbfeFE/FBYRjFmbJQpV--JKtz4i, not stripped"
export TARGETPLATFORM=linux/386
run xx-verify /idontexist
Expand Down
4 changes: 4 additions & 0 deletions src/test_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ supportMipsBuildGo() {
! grep -q 'ID=ubuntu' /etc/os-release && ! grep -q 'VERSION_ID="22.04"' /etc/os-release && versionGTE "$(go version | awk '{print $3}' | sed 's/^go//')" "1.13"
}

supportWindowsArm64Go() {
versionGTE "$(go version | awk '{print $3}' | sed 's/^go//')" "1.17"
}

supportRC() {
command -v llvm-rc >/dev/null 2>&1
}
20 changes: 15 additions & 5 deletions src/xx-verify
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,17 @@ for f in "$@"; do
fi

expArch=""
expArch2="" # extra check for endianness
expArchAlt="" # alternate arch name
expArch2="" # extra check for endianness
case "$TARGETARCH" in
"arm64")
case "$TARGETOS" in
"darwin")
expArch="arm64"
;;
"windows")
expArch="Aarch64"
expArch="ARM64"
expArchAlt="Aarch64"
;;
*)
expArch="ARM aarch64"
Expand Down Expand Up @@ -226,7 +228,8 @@ for f in "$@"; do
expArch2="64-bit LSB"
;;
"386")
expArch="Intel 80386"
expArch="Intel i386"
expArchAlt="Intel 80386"
if [ "$TARGETOS" != "windows" ]; then
expArch2="32-bit LSB"
fi
Expand All @@ -239,8 +242,15 @@ for f in "$@"; do
fi

if ! echo "$out" | grep "$expArch" >/dev/null; then
echo >&2 "file ${f} does not match expected target architecture ${TARGETARCH}: $out"
exit 1
if [ -n "$expArchAlt" ]; then
if ! echo "$out" | grep "$expArchAlt" >/dev/null; then
echo >&2 "file ${f} does not match expected target architecture ${TARGETARCH}: $out"
exit 1
fi
else
echo >&2 "file ${f} does not match expected target architecture ${TARGETARCH}: $out"
exit 1
fi
fi

if [ -n "$expArch2" ]; then
Expand Down

0 comments on commit b0cde9e

Please sign in to comment.