forked from Adyen/adyen-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.52 KB
/
Copy pathios_tests.yml
File metadata and controls
85 lines (73 loc) · 2.52 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
name: Test iOS
on:
workflow_call:
inputs:
device-version:
required: false
default: 15
type: number
react-native-version:
required: false
default: '0.71.14'
type: string
jobs:
ios_tests:
name: Test iOS
runs-on: macos-14
env:
workspace: AdyenExample.xcworkspace
scheme: AdyenExample
device: iPhone ${{ inputs.device-version }}
buildFolder: ./DerivedData
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
cache: 'yarn'
- uses: actions/cache/restore@v4
with:
path: lib
key: temp-lib-${{ github.sha }}
- uses: actions/cache/restore@v4
id: yarn-cache
with:
path: example/node_modules
key: temp-node-${{ github.sha }}
- name: Build dependency if needed
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- uses: actions/cache@v4
with:
path: example/ios/Pods
key: pods-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: pods-
- name: Pod install
working-directory: example/ios
run: pod update
- name: Run tests
working-directory: example/ios
run: |
xcodebuild test \
-workspace ${{ env.workspace }} \
-scheme ${{ env.scheme }} \
-destination "platform=iOS Simulator,name=${{env.device}}" \
-derivedDataPath ${{ env.buildFolder }} \
-enableCodeCoverage YES \
-allowProvisioningUpdates | xcpretty --utf --color && exit ${PIPESTATUS[0]}
- name: Generate code Coverage
working-directory: example/ios
run: |
mkdir ${{ github.workspace }}/reports
${{ github.workspace }}/scripts/xccov-to-sonarqube-generic.sh $(find . -name "*.xcresult") > ${{ github.workspace }}/reports/sonarqube-generic-coverage.xml
sed -i '' "s#${{ github.workspace }}/example/node_modules/@adyen/react-native/##g" ${{ github.workspace }}/reports/sonarqube-generic-coverage.xml
- name: SwiftLint
working-directory: ios
run: |
brew install swiftlint
fastlane run swiftlint output_file:"${{ github.workspace }}/reports/swiftlint.json" reporter:"json" ignore_exit_status:"true"
- name: Archive Coverage report
uses: actions/upload-artifact@v4
with:
name: swift-coverage-report
path: reports