diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a8cec1f8ea..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: Build and Test - -on: - push: - branches: - - master - - develop - - release-* - -jobs: - - tests: - runs-on: macos-14-xlarge - continue-on-error: true - strategy: - fail-fast: false - matrix: - include: - - - version: '18.1' - runtime: 'iOS-18-1' - device: 'iPhone 16' - displayname: 'iPhone-16' - os: 'macos-14-xlarge' - xcode_version: '16.1' - needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 - - - version: '18.1' - runtime: 'iOS-18-1' - device: 'iPad (10th generation)' - displayname: 'iPad-10th-generation' - os: 'macos-14-xlarge' - xcode_version: '16.1' - needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 - - - version: '16.4' - runtime: 'iOS-16-4' - device: 'iPhone 14' - displayname: 'iPhone-14' - os: 'macos-14-xlarge' - xcode_version: '16.1' - needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 - steps: - - uses: actions/checkout@v3 - - uses: n1hility/cancel-previous-runs@v3 - with: - token: ${{ secrets.MANUAL_ACTION_TOKEN }} - - - name: Prepare custom devices - run: | - sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes - - - name: Prepare iOS 11.4 simulator - if: contains(matrix.destination, 'OS=11.4') - run: | - xcversion simulators --install='iOS 11.4' - xcrun simctl create iPhone-6 "iPhone 6" "com.apple.CoreSimulator.SimRuntime.iOS-11-4" - xcrun simctl list devices 11.4 - - - name: Prepare iOS 12.4 simulator - if: contains(matrix.destination, 'OS=12.4') - run: | - xcversion simulators --install='iOS 12.4' - xcrun simctl create iPhone-X "iPhone X" "com.apple.CoreSimulator.SimRuntime.iOS-12-4" - xcrun simctl list devices 12.4 - - - name: Prepare iOS 13.7 simulator - if: contains(matrix.destination, 'OS=13.7') - run: | - xcversion simulators --install='iOS 13.7' - xcrun simctl create iPhone-6 "iPhone X" "com.apple.CoreSimulator.SimRuntime.iOS-13-7" - xcrun simctl list devices 13.7 - - - name: Build and test - run: | - xcodebuild build test -project ${project} -scheme "${scheme}" -destination "${destination}" ${params} | xcpretty && exit ${PIPESTATUS[0]} - env: - project: 'Adyen.xcodeproj' - params: '-derivedDataPath ./DerivedData -enableCodeCoverage YES' - scheme: ${{ matrix.scheme }} - destination: ${{ matrix.destination }} - - sonar: - runs-on: macos-14-xlarge - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: '17' - - - name: Install Dependencies - run: | - brew install sonar-scanner - gem install slather - - - name: Build and test - run: | - xcodebuild build test -project ${project} -scheme "${scheme}" -destination "${destination}" ${params} | xcpretty && exit ${PIPESTATUS[0]} - env: - project: 'Adyen.xcodeproj' - params: '-derivedDataPath ./DerivedData -enableCodeCoverage YES' - scheme: AdyenUIHost - destination: 'name=iPhone 16' - - - name: Slather - run: | - slather coverage --sonarqube-xml ${params} ${project} - slather coverage --cobertura-xml ${params} ${project} - env: - project: 'Adyen.xcodeproj' - params: ' - --build-directory ./DerivedData - --output-directory ./reports - --scheme AdyenUIHost - --binary-basename Adyen - --binary-basename AdyenCard - --binary-basename AdyenDropIn - --binary-basename AdyenWeChatPay - --binary-basename AdyenComponents - --binary-basename AdyenEncryption - --binary-basename AdyenActions - --binary-basename AdyenSwiftUI' - - - name: SwiftLint - run: | - fastlane run swiftlint output_file:"./reports/swiftlint.json" reporter:"json" ignore_exit_status:"true" - - - name: Run Sonar - run: | - git fetch --unshallow --no-tags - sonar-scanner -Dsonar.login=${{ secrets.SONAR_TOKEN }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Code coverage - if: github.ref == 'refs/heads/develop' - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./reports/cobertura.xml diff --git a/.github/workflows/format_project.yml b/.github/workflows/format_project.yml deleted file mode 100644 index 43c2b7ae58..0000000000 --- a/.github/workflows/format_project.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Format project -on: [workflow_dispatch] -jobs: - - Update: - runs-on: macos-14-xlarge - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: n1hility/cancel-previous-runs@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Select latest Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - - name: Format project - run: | - brew install swiftformat - swiftformat . - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - delete-branch: true - branch: format-project-github-action - commit-message: "chore: format project" - title: Format project - body: Format project. - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 7cae0cc7a2..2b96fc801a 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -5,8 +5,11 @@ on: types: [opened, synchronize, reopened] jobs: + select-xcode: + uses: ./.github/workflows/select-xcode.yml build: + needs: select-xcode env: sonarToken: ${{ secrets.SONAR_TOKEN }} destination: "name=iPhone 16 Pro,OS=18.1" @@ -26,7 +29,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '16.1' + xcode-version: '${{ needs.select-xcode.outputs.XCODE_VERSION }}' - name: Install Tools run: | @@ -35,7 +38,10 @@ jobs: - name: Validate 3DS2 SDK version run: | + echo "Preferred Xcode Version: $OUTPUTS_XCODE_VERSION" Scripts/validate-3ds2-SDK-version.sh + env: + OUTPUTS_XCODE_VERSION: '${{ needs.select-xcode.outputs.XCODE_VERSION }}' - name: Validate Adyen SDK version run: | diff --git a/.github/workflows/publish-demo-app.yml b/.github/workflows/publish-demo-app.yml deleted file mode 100644 index 1c39030eb6..0000000000 --- a/.github/workflows/publish-demo-app.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Publish Demo App -on: [workflow_dispatch] -jobs: - - Publish: - runs-on: macos-14-xlarge - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: n1hility/cancel-previous-runs@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Select latest Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - - name: Install the Apple certificate and provisioning profile - env: - BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} - DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }} - P12_PASSWORD: ${{ secrets.P12_PASSWORD }} - BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - run: | - # create variables - CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - DEV_CERTIFICATE_PATH=$RUNNER_TEMP/dev_certificate.p12 - PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db - - # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH - echo -n "$DEVELOPMENT_CERTIFICATE_BASE64" | base64 --decode --output $DEV_CERTIFICATE_PATH - echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH - - # create temporary keychain - security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - - # import release certificate to keychain - security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security import $DEV_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH - - # apply provisioning profile - mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles - - name: Configure Demo App - env: - CLIENT_KEY: ${{ secrets.DEMO_APP_TEST_ENV_CLIENT_KEY }} - DEMO_SERVER_API_KEY: ${{ secrets.DEMO_SERVER_TEST_ENV_API_KEY }} - run: | - # client Key - sed -i '' "s/static let clientKey.*$/static let clientKey = \"$CLIENT_KEY\"/g" ./Demo/Configuration.swift - - # demo server API key - sed -i '' "s/static let demoServerAPIKey.*$/static let demoServerAPIKey = \"$DEMO_SERVER_API_KEY\"/g" ./Demo/Configuration.swift - - name: Publish Demo App - env: - APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }} - APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} - run: | - ./Scripts/publish-demo-app.sh "$APPLE_ID_USERNAME" "$APPLE_APP_SPECIFIC_PASSWORD" diff --git a/.github/workflows/regenerate-docs.yml b/.github/workflows/regenerate-docs.yml deleted file mode 100644 index aebc79c3c4..0000000000 --- a/.github/workflows/regenerate-docs.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Generate Docs -on: [workflow_dispatch] -jobs: - - Generate: - runs-on: macos-14-xlarge - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: n1hility/cancel-previous-runs@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Select latest Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - - name: Generate Docs - run: | - gem install cocoapods - gem install jazzy - Scripts/generate_documentation.sh - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - delete-branch: true - branch: update-docs-github-action - commit-message: "chore: updated documentation" - title: update documentation - body: Regenerate documentation. - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/select-xcode.yml b/.github/workflows/select-xcode.yml new file mode 100644 index 0000000000..051361cc68 --- /dev/null +++ b/.github/workflows/select-xcode.yml @@ -0,0 +1,25 @@ +name: Base Xcode Setup + +on: + workflow_call: + outputs: + XCODE_VERSION: + description: "The shared Xcode version to use" + value: ${{ jobs.setup-xcode.outputs.XCODE_VERSION }} + +jobs: + setup-xcode: + runs-on: macos-14-xlarge + outputs: + XCODE_VERSION: ${{ steps.define-xcode-version.outputs.XCODE_VERSION }} + steps: + - name: Define Xcode Version + id: define-xcode-version + run: | + echo "XCODE_VERSION=16.1" >> "$GITHUB_OUTPUT" + + - name: Check Xcode Version + run: | + echo "outputs.XCODE_VERSION: ${{ env.XCODE_VERSION }}" + env: + XCODE_VERSION: ${{ steps.define-xcode-version.outputs.XCODE_VERSION }} diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml deleted file mode 100644 index 1087ce66db..0000000000 --- a/.github/workflows/spell-check.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Spell check - -on: - pull_request: - types: [opened, synchronize, reopened] - - push: - branches: - - master - - develop - -jobs: - - setup: - runs-on: macos-14-xlarge - steps: - - uses: actions/checkout@v3 - - uses: n1hility/cancel-previous-runs@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - - name: Spell check - run: | - brew install mint - Scripts/spell_check.sh diff --git a/.github/workflows/test-SPM-integration.yml b/.github/workflows/test-SPM-integration.yml deleted file mode 100644 index c618add167..0000000000 --- a/.github/workflows/test-SPM-integration.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Test Swift Package Manager Integration - -on: - pull_request: - types: [opened, synchronize, reopened] - - push: - branches: - - master - - develop - -jobs: - - SPM: - runs-on: macos-14-xlarge - steps: - - uses: actions/checkout@v3 - - uses: n1hility/cancel-previous-runs@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Select latest Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - - name: Test Swift Package Manager Integration - run: | - Scripts/test-SPM-integration.sh diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml deleted file mode 100644 index 649326843e..0000000000 --- a/.github/workflows/test-carthage-integration.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Test Carthage Integration - -on: - pull_request: - types: [opened, synchronize, reopened] - - push: - branches: - - master - - develop - -jobs: - - carthage: - runs-on: macos-14-xlarge - steps: - - uses: actions/checkout@v4 - - uses: n1hility/cancel-previous-runs@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Select latest Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - - name: Resolve dependencies - run: | - brew update - brew install xcodegen - brew install carthage - brew upgrade carthage - - - name: Test Carthage Integration - env: - GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - carthage version - Scripts/test-carthage-integration.sh \ No newline at end of file diff --git a/.github/workflows/test_cocoapods_integration.yml b/.github/workflows/test_cocoapods_integration.yml deleted file mode 100644 index 32b0c107b4..0000000000 --- a/.github/workflows/test_cocoapods_integration.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Test Cocoapods Integration - -on: - pull_request: - types: [opened, synchronize, reopened] - - push: - branches: - - master - - develop - -jobs: - - pods: - runs-on: macos-14-xlarge - steps: - - uses: actions/checkout@v4 - - uses: n1hility/cancel-previous-runs@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Select latest Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - - name: Lint Cocoapods - run: | - brew update - brew install xcodegen - gem install cocoapods -v 1.10.2 - pod repo update - pod lib lint Adyen.podspec --allow-warnings --verbose - - - name: Test Cocoapods Integration - run: | - Scripts/test-CocoaPods-integration.sh -w - Scripts/test-CocoaPods-integration.sh \ No newline at end of file diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml deleted file mode 100644 index a712962e83..0000000000 --- a/.github/workflows/update-version.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Update version number -on: - workflow_dispatch: - inputs: - newVersion: - description: 'The new version' - required: true -jobs: - - Update: - runs-on: macos-14-xlarge - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: n1hility/cancel-previous-runs@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Select latest Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - - name: Update version number - run: | - Scripts/increment_version.sh ${{ github.event.inputs.newVersion }} - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - delete-branch: true - branch: update-version-github-action - commit-message: "chore: updated version" - title: Update version - body: Update version. - token: ${{ secrets.GITHUB_TOKEN }}