diff --git a/.github/actions/smoke-tests-darwin/action.yml b/.github/actions/smoke-tests-darwin/action.yml new file mode 100644 index 00000000..b19a2b5b --- /dev/null +++ b/.github/actions/smoke-tests-darwin/action.yml @@ -0,0 +1,42 @@ +name: Run iOS/macOS smoke tests +description: Execute the smoke test suite on iOS/macOS + +inputs: + platform: + description: Either iOS or macOS + required: true + + destination: + description: The destination string for xcodebuild + required: true + +runs: + using: composite + + steps: + - name: Lowercase platform value + id: lowercase-platform + run: echo "platform=$(echo ${{ inputs.platform }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" + shell: bash + + - name: Build ${{ inputs.platform }} app + working-directory: auth0_flutter/example/${{ steps.lowercase-platform.outputs.platform }} + run: flutter build ${{ steps.lowercase-platform.outputs.platform }} --debug ${{ inputs.platform == 'iOS' && '--no-codesign' || '' }} + shell: bash + + - name: Disable iOS hardware keyboard + if: ${{ inputs.platform == 'iOS' }} + run: defaults write com.apple.iphonesimulator ConnectHardwareKeyboard 0 + shell: bash + + - name: Run ${{ inputs.platform }} smoke tests + working-directory: auth0_flutter/example/${{ steps.lowercase-platform.outputs.platform }} + run: xcodebuild test -scheme Runner -workspace Runner.xcworkspace -destination '${{ inputs.destination }}' -resultBundlePath smoke-tests.xcresult -only-testing:RunnerUITests + shell: bash + + - name: Upload xcresult bundles + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 + if: ${{ failure() }} + with: + name: '${{ inputs.platform }} xcresult bundles (smoke tests)' + path: 'auth0_flutter/example/${{ steps.lowercase-platform.outputs.platform }}/smoke-tests.xcresult' diff --git a/.github/actions/unit-tests-darwin/action.yml b/.github/actions/unit-tests-darwin/action.yml index 1bcb3c19..a1d83912 100644 --- a/.github/actions/unit-tests-darwin/action.yml +++ b/.github/actions/unit-tests-darwin/action.yml @@ -29,4 +29,4 @@ runs: if: ${{ failure() }} with: name: '${{ inputs.platform }} xcresult bundles (unit tests)' - path: 'auth0_flutter/example/${{ steps.lowercase-platform.outputs.platform }}/*.xcresult' + path: 'auth0_flutter/example/${{ steps.lowercase-platform.outputs.platform }}/unit-tests.xcresult' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e8c884e..58c96bfb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,5 @@ name: CI + on: pull_request: types: @@ -199,18 +200,10 @@ jobs: auth0-client-id: ${{ vars.AUTH0_CLIENT_ID }} - name: Run iOS smoke tests - if: ${{ github.event.pull_request.head.repo.fork == false }} - working-directory: auth0_flutter/example/ios - run: | - defaults write com.apple.iphonesimulator ConnectHardwareKeyboard 0 - xcodebuild test -scheme Runner -workspace Runner.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 14' -resultBundlePath smoke-tests.xcresult -only-testing:RunnerUITests - - - name: Upload xcresult bundles - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - if: ${{ failure() }} + uses: ./.github/actions/smoke-tests-darwin with: - name: 'iOS xcresult bundles (smoke tests)' - path: 'auth0_flutter/example/ios/*.xcresult' + platform: ${{ env.platform }} + destination: 'platform=iOS Simulator,name=iPhone 14' test-macos-unit: name: Run native macOS unit tests using Xcode ${{ matrix.xcode }} @@ -249,6 +242,41 @@ jobs: platform: ${{ env.platform }} destination: platform=macOS,arch=x86_64 + test-macos-smoke: + name: Run native macOS smoke tests using Xcode ${{ matrix.xcode }} + needs: authorize + runs-on: macos-13 + environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }} + + env: + platform: macOS + USER_EMAIL: ${{ secrets.USER_EMAIL }} + USER_PASSWORD: ${{ secrets.USER_PASSWORD }} + + strategy: + matrix: + xcode: + - '15.0.1' + + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + + - name: Set up environment + uses: ./.github/actions/setup-darwin + with: + platform: ${{ env.platform }} + flutter: ${{ env.flutter }} + xcode: ${{ matrix.xcode }} + auth0-domain: ${{ vars.AUTH0_DOMAIN }} + auth0-client-id: ${{ vars.AUTH0_CLIENT_ID }} + + - name: Run macOS smoke tests + uses: ./.github/actions/smoke-tests-darwin + with: + platform: ${{ env.platform }} + destination: platform=macOS,arch=x86_64 + test-android-unit: name: Run native Android unit tests needs: authorize @@ -408,22 +436,26 @@ jobs: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a + - name: Download coverage report for auth0_flutter + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: name: auth0_flutter coverage path: coverage/auth0_flutter - - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a + - name: Download coverage report for auth0_flutter_platform_interface + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: name: auth0_flutter_platform_interface coverage path: coverage/auth0_flutter_platform_interface - - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a + - name: Download coverage report for iOS + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: name: iOS coverage path: coverage/ios - - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a + - name: Download coverage report for Android + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: name: Android coverage path: coverage/android diff --git a/auth0_flutter/example/ios/Runner.xcodeproj/project.pbxproj b/auth0_flutter/example/ios/Runner.xcodeproj/project.pbxproj index 4aa43cac..3d5ef860 100644 --- a/auth0_flutter/example/ios/Runner.xcodeproj/project.pbxproj +++ b/auth0_flutter/example/ios/Runner.xcodeproj/project.pbxproj @@ -744,7 +744,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 22U9KJ5PK6; + DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -828,7 +828,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 22U9KJ5PK6; + DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; diff --git a/auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj b/auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj index 919f91d3..3bee7cbe 100644 --- a/auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj +++ b/auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj @@ -1014,7 +1014,7 @@ GCC_WARN_UNDECLARED_SELECTOR = YES; GENERATE_INFOPLIST_FILE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 14.0; + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -1048,7 +1048,7 @@ GCC_WARN_UNDECLARED_SELECTOR = YES; GENERATE_INFOPLIST_FILE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 14.0; + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.auth0.sdks.Flutter.RunnerUITests; @@ -1080,7 +1080,7 @@ GCC_WARN_UNDECLARED_SELECTOR = YES; GENERATE_INFOPLIST_FILE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 14.0; + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.auth0.sdks.Flutter.RunnerUITests;