-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (103 loc) · 4.32 KB
/
Copy pathswift.yml
File metadata and controls
108 lines (103 loc) · 4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Swift CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
MIN_SWIFT_VERSION: "6.0"
MIN_XCODE_VERSION: "16.2"
IOS_DESTINATION: "platform=iOS Simulator,name=iPhone 16e,OS=26.2"
jobs:
linux-test:
runs-on: ubuntu-latest
env:
TEST_CONFIGURATION_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Verify Swift version
run: |
swift --version
actual=$(swift --version | grep -oE '[0-9]+\.[0-9]+' | head -n1)
actual_major=${actual%%.*}; actual_minor=${actual#*.}
min_major=${MIN_SWIFT_VERSION%%.*}; min_minor=${MIN_SWIFT_VERSION#*.}
if [ "$actual_major" -gt "$min_major" ] || { [ "$actual_major" -eq "$min_major" ] && [ "$actual_minor" -ge "$min_minor" ]; }; then
echo "Swift $actual satisfies minimum $MIN_SWIFT_VERSION"
else
echo "::error::Swift $actual is below the minimum supported $MIN_SWIFT_VERSION"
exit 1
fi
- name: Build
run: make build
- name: Test
run: make test
- name: Run example
run: make example
- name: Run snippets
run: make snippets-test
macos-test:
runs-on: macos-latest
needs: linux-test
env:
TEST_CONFIGURATION_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Verify Xcode version
run: |
xcodebuild -version
actual=$(xcodebuild -version | head -n1 | grep -oE '[0-9]+\.[0-9]+' | head -n1)
actual_major=${actual%%.*}; actual_minor=${actual#*.}
min_major=${MIN_XCODE_VERSION%%.*}; min_minor=${MIN_XCODE_VERSION#*.}
if [ "$actual_major" -gt "$min_major" ] || { [ "$actual_major" -eq "$min_major" ] && [ "$actual_minor" -ge "$min_minor" ]; }; then
echo "Xcode $actual satisfies minimum $MIN_XCODE_VERSION"
else
echo "::error::Xcode $actual is below the minimum supported $MIN_XCODE_VERSION"
exit 1
fi
- name: Verify Swift version
run: |
swift --version
actual=$(swift --version | grep -oE '[0-9]+\.[0-9]+' | head -n1)
actual_major=${actual%%.*}; actual_minor=${actual#*.}
min_major=${MIN_SWIFT_VERSION%%.*}; min_minor=${MIN_SWIFT_VERSION#*.}
if [ "$actual_major" -gt "$min_major" ] || { [ "$actual_major" -eq "$min_major" ] && [ "$actual_minor" -ge "$min_minor" ]; }; then
echo "Swift $actual satisfies minimum $MIN_SWIFT_VERSION"
else
echo "::error::Swift $actual is below the minimum supported $MIN_SWIFT_VERSION"
exit 1
fi
- name: Build
run: make build
- name: Test
run: make test
- name: Run example
run: make example
ios-test:
runs-on: macos-latest
needs: linux-test
env:
TEST_CONFIGURATION_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Verify Xcode version
run: |
xcodebuild -version
actual=$(xcodebuild -version | head -n1 | grep -oE '[0-9]+\.[0-9]+' | head -n1)
actual_major=${actual%%.*}; actual_minor=${actual#*.}
min_major=${MIN_XCODE_VERSION%%.*}; min_minor=${MIN_XCODE_VERSION#*.}
if [ "$actual_major" -gt "$min_major" ] || { [ "$actual_major" -eq "$min_major" ] && [ "$actual_minor" -ge "$min_minor" ]; }; then
echo "Xcode $actual satisfies minimum $MIN_XCODE_VERSION"
else
echo "::error::Xcode $actual is below the minimum supported $MIN_XCODE_VERSION"
exit 1
fi
- name: Build
run: xcodebuild build -scheme AsposeBarcodeCloud -destination "$IOS_DESTINATION"
# iOS tests are disabled: `xcodebuild test` fails with
# "Scheme AsposeBarcodeCloud is not currently configured for the test action"
# because the SwiftPM-generated scheme does not expose the test target for the
# iOS Simulator destination. The Build step above still verifies the SDK compiles
# for iOS; test coverage runs on linux-test and macos-test.
# To re-enable once the scheme is test-configured:
# - name: Test
# run: xcodebuild test -scheme AsposeBarcodeCloud -destination "$IOS_DESTINATION"