File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 43
43
docker create --name second --pull always localhost:5000/layering_test
44
44
docker cp second:/payload second.payload
45
45
grep second second.payload
46
+
47
+ elf-detection-test :
48
+ name : ELF detection test
49
+ runs-on : ubuntu-latest
50
+ services :
51
+ registry :
52
+ image : registry:2
53
+ ports :
54
+ - 5000:5000
55
+ steps :
56
+ - name : Checkout repository
57
+ uses : actions/checkout@v4
58
+ with :
59
+ persist-credentials : false
60
+
61
+ - name : Mark the workspace as safe
62
+ # https://github.com/actions/checkout/issues/766
63
+ run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
64
+
65
+ - name : Install the static SDK
66
+ run : |
67
+ swift sdk install \
68
+ https://download.swift.org/swift-6.0.2-release/static-sdk/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz \
69
+ --checksum aa5515476a403797223fc2aad4ca0c3bf83995d5427fb297cab1d93c68cee075
70
+
71
+ # Run the test script
72
+ - name : Test ELF detection
73
+ run : |
74
+ scripts/test-elf-detection.sh
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -ex -o pipefail
4
+
5
+ PKGPATH=$( mktemp -d)
6
+ swift package --package-path " $PKGPATH " init --type executable --name hello
7
+
8
+ # Build and package an x86_64 binary
9
+ swift build --package-path " $PKGPATH " --swift-sdk x86_64-swift-linux-musl
10
+ file " $PKGPATH /.build/x86_64-swift-linux-musl/debug/hello"
11
+ IMGREF=$( swift run containertool --repository localhost:5000/elf_test " $PKGPATH /.build/x86_64-swift-linux-musl/debug/hello" --from scratch)
12
+ docker pull " $IMGREF "
13
+ docker inspect " $IMGREF " --format " {{.Architecture}}" | grep amd64
14
+ echo x86_64 detection: PASSED
15
+
16
+ # Build and package an aarch64 binary
17
+ swift build --package-path " $PKGPATH " --swift-sdk aarch64-swift-linux-musl
18
+ file " $PKGPATH /.build/aarch64-swift-linux-musl/debug/hello"
19
+ IMGREF=$( swift run containertool --repository localhost:5000/elf_test " $PKGPATH /.build/aarch64-swift-linux-musl/debug/hello" --from scratch)
20
+ docker pull " $IMGREF "
21
+ docker inspect " $IMGREF " --format " {{.Architecture}}" | grep arm64
22
+
23
+ echo aarch64 detection: PASSED
You can’t perform that action at this time.
0 commit comments