Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kalidax committed Feb 16, 2024
1 parent 1807888 commit c4bc5eb
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions .github/workflows/build-ampd-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,32 +98,33 @@ jobs:
working-directory: ./ampdbin
run: |
for binary in ./ampd-*; do
if [[ "$binary" != *.asc ]]; then
echo "Testing binary: $binary"
if [[ "${{ matrix.os }}" == "ubuntu-22.04" ]]; then
OUTPUT=$(file "$binary" | awk -F, '{print $1"," $2}')
if [[ "${{ matrix.arch }}" == "amd64" ]]; then
EXPECTED="ELF 64-bit LSB pie executable, x86-64"
elif [[ "${{ matrix.arch }}" == "arm64" ]]; then
EXPECTED="ELF 64-bit LSB pie executable, ARM aarch64"
fi
elif [[ "${{ matrix.os }}" == "macos-12" ]]; then
OUTPUT=$(file "$binary")
if [[ "${{ matrix.arch }}" == "amd64" ]]; then
EXPECTED="Mach-O 64-bit executable x86_64"
elif [[ "${{ matrix.arch }}" == "arm64" ]]; then
EXPECTED="Mach-O 64-bit executable arm64"
fi
if [[ "$binary" != *.asc ]]; then
echo "Testing binary: $binary"
OUTPUT=$(file "$binary" | cut -d: -f2- | awk -F, '{print $1"," $2}')
if [[ "${{ matrix.os }}" == "ubuntu-22.04" ]]; then
if [[ "${{ matrix.arch }}" == "amd64" ]]; then
EXPECTED="ELF 64-bit LSB pie executable, x86-64"
elif [[ "${{ matrix.arch }}" == "arm64" ]]; then
EXPECTED="ELF 64-bit LSB pie executable, ARM aarch64"
fi
echo "Output: $OUTPUT"
echo "Expected: $EXPECTED"

if [[ "$OUTPUT" == *"$EXPECTED"* ]]; then
echo "The binary format is correct."
else
echo "Error: The binary format does not match the expected format."
exit 1
elif [[ "${{ matrix.os }}" == "macos-12" ]]; then
OUTPUT=$(file "$binary" | cut -d: -f2-)
if [[ "${{ matrix.arch }}" == "amd64" ]]; then
EXPECTED="Mach-O 64-bit executable x86_64"
elif [[ "${{ matrix.arch }}" == "arm64" ]]; then
EXPECTED="Mach-O 64-bit executable arm64"
fi
fi
done
echo "Output: $OUTPUT"
echo "Expected: $EXPECTED"
if [[ "$OUTPUT" == *"$EXPECTED"* ]]; then
echo "The binary format is correct."
else
echo "Error: The binary format does not match the expected format."
exit 1
fi
fi
done

0 comments on commit c4bc5eb

Please sign in to comment.