Using iOS 18 for pr scan #6720
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Scan PR | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
push: | |
branches: | |
- develop | |
jobs: | |
build: | |
env: | |
sonarToken: ${{ secrets.SONAR_TOKEN }} | |
destination: "name=iPhone 16 Pro,OS=18.0" | |
project: "Adyen.xcodeproj" | |
params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" | |
runs-on: macos-15-xlarge # Apple Silicon Runner | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: n1hility/cancel-previous-runs@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Validate Versions | |
run: | | |
Scripts/validate-3ds2-SDK-version.sh | |
Scripts/validate-Adyen-SDK-version.sh | |
- name: Select latest Xcode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '16.0' | |
- name: π οΈ Install Tools | |
run: | | |
brew install sonar-scanner | |
- name: π· Clean Build | |
run: | | |
xcodebuild -version | |
xcodebuild clean build -project "${{env.project}}" -scheme "${scheme}" ${params} -destination "${{env.destination}}" | xcpretty --utf --color && exit ${PIPESTATUS[0]} | |
env: | |
params: '${{env.params}}' | |
scheme: 'AdyenUIHost' | |
- name: π§ͺ Unit + Integration Tests | |
run: | | |
xcodebuild test \ | |
-project "${{env.project}}" \ | |
-scheme "${scheme}" \ | |
-testPlan "${testPlan}" \ | |
-enableCodeCoverage YES \ | |
-resultBundlePath "${resultPath}" \ | |
${params} \ | |
-destination "${{env.destination}}" | xcpretty --utf --color && exit ${PIPESTATUS[0]} | |
env: | |
params: '${{env.params}}' | |
scheme: 'AdyenUIHost' | |
testPlan: 'CI' | |
resultPath: 'Test-CI-Result.xcresult' | |
- name: π Snapshot Tests | |
run: | | |
xcodebuild test \ | |
-project "${{env.project}}" \ | |
-scheme "${scheme}" \ | |
-testPlan "${testPlan}" \ | |
-enableCodeCoverage YES \ | |
-resultBundlePath "${resultPath}" \ | |
${params} \ | |
-destination "name=iPhone 16 Pro,OS=18.0" -destination "name=iPad (10th generation),OS=18.0" | xcpretty --utf --color && exit ${PIPESTATUS[0]} | |
env: | |
params: '${{env.params}}' | |
scheme: 'SnapshotTests' | |
testPlan: 'SnapshotTests' | |
resultPath: 'Test-Snapshots-Result.xcresult' | |
- name: π Prepare coverage reports | |
run: | | |
bash Scripts/xccov-to-sonarqube-generic.sh Test-Snapshots-Result.xcresult/ > sonarqube-coverage-snapshots.xml | |
sed "s#$PWD/##g" sonarqube-coverage-snapshots.xml > sonarqube_updated_snapshots.xml | |
bash Scripts/xccov-to-sonarqube-generic.sh Test-CI-Result.xcresult/ > sonarqube-coverage-ci.xml | |
sed "s#$PWD/##g" sonarqube-coverage-ci.xml > sonarqube_updated_ci.xml | |
- name: π§Ό SwiftLint | |
run: | | |
brew install swiftlint | |
fastlane run swiftlint output_file:"reports/swiftlint.json" reporter:"json" ignore_exit_status:"true" | |
- name: π‘ Run Sonar | |
if: ${{ env.sonarToken != 0 }} | |
run: | | |
git fetch --unshallow --no-tags | |
sonar-scanner -Dsonar.token=${{ secrets.SONAR_TOKEN }} -Dsonar.coverageReportPaths=sonarqube_updated_CI.xml,sonarqube_updated_snapshots.xml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |