@@ -10,75 +10,89 @@ jobs:
1010 macOS :
1111 name : Test macOS
1212 runs-on : macos-latest
13- env :
14- DEVELOPER_DIR : /Applications/Xcode_14.2.app/Contents/Developer
1513 steps :
16- - uses : actions/checkout@v1
14+ - name : Checkout repository
15+ uses : actions/checkout@v3
16+
17+ - name : Configure Git credentials
18+ run : |
19+ git config --global url."https://x-access-token:${{ secrets.PKG_TOKEN }}@github.com/".insteadOf "https://github.com/"
20+
21+ - name : Set up Ruby (for installing Bundler and Fastlane)
22+ uses : ruby/setup-ruby@v1
23+ with :
24+ ruby-version : ' 3.0'
25+
26+ - name : Install dep via Carthage
27+ run : |
28+ carthage bootstrap --platform macOS --use-xcframeworks --cache-builds
29+
30+ - name : Install dependencies via Swift Package Manager
31+ run : swift package resolve
32+
33+ - name : Set up Xcode
34+ uses : maxim-lobanov/setup-xcode@v1
1735 with :
18- path : Carthage
19- key : ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
20- restore-keys : |
21- ${{ runner.os }}-carthage-
22- - name : Dependencies
23- run : carthage bootstrap --no-use-binaries --platform macOS
24- - name : Dependency libxml2
25- run : brew install libxml2 && brew link --force libxml2
26- - name : macOS
27- run : set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack macOS" SWIFT_ACTIVE_COMPILATION_CONDITIONS="NO_FATAL_TEST" -destination "platform=macOS" test | xcpretty
36+ xcode-version : ' 15.4.0'
37+
38+ - name : Create config file
39+ run : |
40+ echo '{
41+ "api_key": "${{ secrets.api_key }}",
42+ "delivery_token": "${{ secrets.delivery_token }}",
43+ "environment": "${{ secrets.environment }}"
44+ }' > Tests/config.json
45+
46+ - name : Build and run tests
47+ run : |
48+ xcodebuild test \
49+ -workspace Contentstack.xcworkspace \
50+ -scheme "Contentstack macOS Tests" \
51+ -destination 'platform=macOS,arch=arm64' \
52+ ONLY_ACTIVE_ARCH=NO \
53+ CODE_SIGNING_ALLOWED=NO
2854 iOS :
2955 name : Test iOS
3056 runs-on : macos-latest
31- env :
32- DEVELOPER_DIR : /Applications/Xcode_14.2.app/Contents/Developer
33- strategy :
34- matrix :
35- destination : ["OS=16.2,name=iPhone 14 Pro"]
3657 steps :
37- - uses : actions/checkout@v1
58+ - name : Checkout repository
59+ uses : actions/checkout@v3
60+
61+ - name : Configure Git credentials
62+ run : |
63+ git config --global url."https://x-access-token:${{ secrets.PKG_TOKEN }}@github.com/".insteadOf "https://github.com/"
64+
65+ - name : Set up Ruby (for installing Bundler and Fastlane)
66+ uses : ruby/setup-ruby@v1
3867 with :
39- path : Carthage
40- key : ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
41- restore-keys : |
42- ${{ runner.os }}-carthage-
43- - name : Dependencies
44- run : carthage bootstrap --no-use-binaries --platform iOS --use-xcframeworks
45- - name : iOS - ${{ matrix.destination }}
46- run : set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack iOS" SWIFT_ACTIVE_COMPILATION_CONDITIONS="NO_FATAL_TEST" -destination "${{ matrix.destination }}" test | xcpretty
68+ ruby-version : ' 3.0 '
69+
70+ - name : Install dep via Carthage
71+ run : |
72+ carthage bootstrap --platform iOS --use-xcframeworks --cache-builds
73+
74+ - name : Install dependencies via Swift Package Manager
75+ run : swift package resolve
4776
48- tvOS :
49- name : Test tvOS
50- runs-on : macos-latest
51- env :
52- DEVELOPER_DIR : /Applications/Xcode_14.2.app/Contents/Developer
53- strategy :
54- matrix :
55- destination : ["OS=16.1,name=Apple TV 4K (2nd generation)"]
56- steps :
57- - uses : actions/checkout@v1
77+ - name : Set up Xcode
78+ uses : maxim-lobanov/setup-xcode@v1
5879 with :
59- path : Carthage
60- key : ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
61- restore-keys : |
62- ${{ runner.os }}-carthage-
63- - name : Dependencies
64- run : carthage bootstrap --no-use-binaries --platform tvOS --use-xcframeworks
65- - name : tvOS - ${{ matrix.destination }}
66- run : set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack tvOS" SWIFT_ACTIVE_COMPILATION_CONDITIONS="NO_FATAL_TEST" -destination "${{ matrix.destination }}" test | xcpretty
80+ xcode-version : ' 15.4.0'
81+
82+ - name : Create config file
83+ run : |
84+ echo '{
85+ "api_key": "${{ secrets.api_key }}",
86+ "delivery_token": "${{ secrets.delivery_token }}",
87+ "environment": "${{ secrets.environment }}"
88+ }' > Tests/config.json
6789
68- watchOS :
69- name : Test watchOS
70- runs-on : macos-latest
71- env :
72- DEVELOPER_DIR : /Applications/Xcode_14.2.app/Contents/Developer
73- strategy :
74- matrix :
75- destination : ["OS=9.1,name=Apple Watch Series 6 (44mm)"]
76- steps :
77- - uses : actions/checkout@v1
78- with :
79- path : Carthage
80- key : ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
81- restore-keys : |
82- ${{ runner.os }}-carthage-
83- - name : watchOS - ${{ matrix.destination }}
84- run : set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack watchOS" -destination "${{ matrix.destination }}" build | xcpretty
90+ - name : Build and run tests
91+ run : |
92+ xcodebuild test \
93+ -workspace Contentstack.xcworkspace \
94+ -scheme "Contentstack iOS Tests" \
95+ -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.2' \
96+ -sdk iphonesimulator \
97+ ONLY_ACTIVE_ARCH=NO \
98+ CODE_SIGNING_ALLOWED=NO
0 commit comments