40
40
fail-fast : false
41
41
matrix :
42
42
# build only x86_64 to speed up the validation
43
- arch : ['x86_64']
44
- # arch: ['x86_64', '']
43
+ # arch: ['x86_64']
44
+ arch : ['x86_64', '']
45
45
runs-on : ubuntu-24.04
46
46
steps :
47
47
- name : Checkout repository
@@ -54,14 +54,18 @@ jobs:
54
54
run : |
55
55
TARGET_ARCHS=${{ matrix.arch }} ./build
56
56
- name : Get artifact info
57
- id : paths
57
+ id : info
58
+ shell : bash
58
59
run : |
60
+ set -ex
59
61
SWIFT_ROOT=$(dirname ${{ runner.temp }}/swift-android-sdk/host-toolchain/*/usr)
60
62
echo "swift-root=${SWIFT_ROOT}" >> $GITHUB_OUTPUT
61
63
echo "swift-path=${SWIFT_ROOT}/usr/bin/swift" >> $GITHUB_OUTPUT
62
64
65
+ ARTIFACT_BUILD=$(realpath ${{ runner.temp }}/swift-android-sdk/build/*.artifactbundle)
63
66
ARTIFACT_PATH=$(realpath ${{ runner.temp }}/swift-android-sdk/products/*.artifactbundle.tar.gz)
64
67
echo "artifact-path=${ARTIFACT_PATH}" >> $GITHUB_OUTPUT
68
+ echo "sdk-id=x86_64-unknown-linux-android28" >> $GITHUB_OUTPUT
65
69
66
70
ARTIFACT_EXT=".artifactbundle.tar.gz"
67
71
ARTIFACT_NAME="$(basename ${ARTIFACT_PATH} ${ARTIFACT_EXT})"
@@ -78,12 +82,35 @@ jobs:
78
82
79
83
# e.g.: swift-6.1-RELEASE_android-0.1-x86_64.artifactbundle.tar.gz
80
84
echo "artifact-name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
85
+
86
+ # validate some required paths in the artifactbundle
87
+ pushd ${ARTIFACT_BUILD}/*/*/usr
88
+ ls lib/swift/android
89
+ ls lib/swift/android/*
90
+ ls lib/swift/android/*/swiftrt.o
91
+ ls lib/*-linux-android/*/crtbegin_dynamic.o
92
+
93
+ ls lib/swift_static-*
94
+ ls lib/swift_static-*/android
95
+ ls lib/swift_static-*/android/libFoundationEssentials.a
96
+
97
+ ls lib/*-linux-android/libFoundationEssentials.so
98
+ ls lib/*-linux-android/libFoundationNetworking.so
99
+ ls lib/*-linux-android/libFoundationInternationalization.so
100
+ ls lib/*-linux-android/lib_FoundationICU.so
101
+ ls lib/*-linux-android/libFoundationXML.so
102
+ ls lib/*-linux-android/libTesting.so
103
+
104
+ ls lib/swift/clang/lib
105
+ ls lib/swift/clang/lib/linux
106
+ ls lib/swift/clang/lib/linux/*/libunwind.a
107
+ popd
81
108
- name : Upload SDK artifactbundle
82
109
uses : actions/upload-artifact@v4
83
110
with :
84
111
compression-level : 0
85
- name : ${{ steps.paths .outputs.artifact-name }}
86
- path : ${{ steps.paths .outputs.artifact-path }}
112
+ name : ${{ steps.info .outputs.artifact-name }}
113
+ path : ${{ steps.info .outputs.artifact-path }}
87
114
- name : Cleanup
88
115
run : |
89
116
# need to free up some space or else when installing we get: No space left on device
@@ -92,65 +119,41 @@ jobs:
92
119
shell : bash
93
120
run : |
94
121
set -ex
95
- ${{ steps.paths .outputs.swift-path }} sdk install ${{ steps.paths .outputs.artifact-path }}
96
- ${{ steps.paths .outputs.swift-path }} sdk configure --show-configuration $(${{ steps.paths .outputs.swift-path }} sdk list | head -n 1) x86_64-unknown-linux-android28
122
+ ${{ steps.info .outputs.swift-path }} sdk install ${{ steps.info .outputs.artifact-path }}
123
+ ${{ steps.info .outputs.swift-path }} sdk configure --show-configuration $(${{ steps.info .outputs.swift-path }} sdk list | head -n 1) ${{ steps.info.outputs.sdk-id }}
97
124
# recent releases require that ANDROID_NDK_ROOT *not* be set
98
125
# see https://github.com/finagolfin/swift-android-sdk/issues/207
99
126
echo "ANDROID_NDK_ROOT=" >> $GITHUB_ENV
100
-
101
- # validate some required paths in the artifactbundle
102
- cd ${HOME}/.config/swiftpm/swift-sdks/*.artifactbundle/*/*/usr
103
- pwd
104
-
105
- ls lib/swift/android
106
- ls lib/swift/android/*
107
- ls lib/swift/android/*/swiftrt.o
108
- ls lib/*-linux-android/*/crtbegin_dynamic.o
109
-
110
- ls lib/swift_static-*
111
- ls lib/swift_static-*/android
112
- ls lib/swift_static-*/android/libFoundationEssentials.a
113
-
114
- ls lib/*-linux-android/libFoundationEssentials.so
115
- ls lib/*-linux-android/libFoundationNetworking.so
116
- ls lib/*-linux-android/libFoundationInternationalization.so
117
- ls lib/*-linux-android/lib_FoundationICU.so
118
- ls lib/*-linux-android/libFoundationXML.so
119
- ls lib/*-linux-android/libTesting.so
120
-
121
- ls lib/swift/clang/lib
122
- ls lib/swift/clang/lib/linux
123
- ls lib/swift/clang/lib/linux/*/libunwind.a
124
127
- name : Build Demo Project
125
128
run : |
126
129
cd ${{ runner.temp }}
127
130
mkdir DemoProject
128
131
cd DemoProject
129
- ${{ steps.paths .outputs.swift-path }} --version
130
- ${{ steps.paths .outputs.swift-path }} package init
132
+ ${{ steps.info .outputs.swift-path }} --version
133
+ ${{ steps.info .outputs.swift-path }} package init
131
134
echo 'import Foundation' >> Sources/DemoProject/DemoProject.swift
132
135
echo 'import FoundationEssentials' >> Sources/DemoProject/DemoProject.swift
133
136
echo 'import FoundationXML' >> Sources/DemoProject/DemoProject.swift
134
137
echo 'import FoundationNetworking' >> Sources/DemoProject/DemoProject.swift
135
138
echo 'import Dispatch' >> Sources/DemoProject/DemoProject.swift
136
139
echo 'import Android' >> Sources/DemoProject/DemoProject.swift
137
- ${{ steps.paths .outputs.swift-path }} build --build-tests --swift-sdk x86_64-unknown-linux-android28
140
+ ${{ steps.info .outputs.swift-path }} build --build-tests --swift-sdk ${{ steps.info.outputs.sdk-id }}
138
141
- name : Test Demo Project on Android
139
142
uses : skiptools/swift-android-action@main
140
143
with :
141
144
package-path : ${{ runner.temp }}/DemoProject
142
- installed-sdk : x86_64-unknown-linux-android28
143
- installed-swift : ${{ steps.paths .outputs.swift-root }}
145
+ installed-sdk : ${{ steps.info.outputs.sdk-id }}
146
+ installed-swift : ${{ steps.info .outputs.swift-root }}
144
147
- name : Build swift-algorithms
145
148
run : |
146
149
cd ${{ runner.temp }}
147
150
git clone https://github.com/apple/swift-algorithms.git
148
151
cd swift-algorithms
149
- ${{ steps.paths .outputs.swift-path }} build --build-tests --swift-sdk x86_64-unknown-linux-android28
152
+ ${{ steps.info .outputs.swift-path }} build --build-tests --swift-sdk ${{ steps.info.outputs.sdk-id }}
150
153
- name : Test swift-algorithms on Android
151
154
uses : skiptools/swift-android-action@main
152
155
with :
153
156
# package-path: ${{ runner.temp }}/DemoProject
154
157
package-path : ${{ runner.temp }}/swift-algorithms
155
- installed-sdk : x86_64-unknown-linux-android28
156
- installed-swift : ${{ steps.paths .outputs.swift-root }}
158
+ installed-sdk : ${{ steps.info.outputs.sdk-id }}
159
+ installed-swift : ${{ steps.info .outputs.swift-root }}
0 commit comments