Skip to content

Commit

Permalink
Add basic iOS test flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket committed Aug 21, 2023
1 parent e080e98 commit ece36d9
Showing 1 changed file with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,64 @@ jobs:
name: Auth0 Flutter
flags: auth0_flutter_platform_interface
files: ./auth0_flutter_platform_interface/coverage/lcov.info


- name: Cancel wokflow on failure
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1
if: ${{ failure() }}

test-ios:
name: Test iOS native code
runs-on: macos-latest

env:
xcode: '14.2'
simulator: iPhone 14

steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Install Flutter
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: ${{ env.flutter-version }}
channel: stable
cache: true

- name: Setup Xcode
uses: mxcl/xcodebuild@6e60022a0cbe8c89278be2dd1773a2f68e7c5c87
with:
xcode: ${{ env.xcode }}
action: none

- name: Set Ruby version
working-directory: auth0_flutter_platform_interface
run: ruby -e 'puts RUBY_VERSION' | tee .ruby-version
shell: bash

- name: Set up Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939
with:
bundler-cache: true
cache-version: 1
working-directory: auth0_flutter/example/ios

- name: Install pods
working-directory: auth0_flutter/example/ios
run: bundle exec pod install

- name: Set .env
working-directory: auth0_flutter/example/ios
run: printf '%s\n%s\n%s' "AUTH0_DOMAIN=$AUTH0_DOMAIN" "AUTH0_CLIENT_ID=$AUTH0_CLIENT_ID" 'AUTH0_CUSTOM_SCHEME=demo' >> ../.env

- name: Run iOS unit tests
working-directory: auth0_flutter/example/ios
run: xcodebuild test -scheme Runner -workspace Runner.workspace -destination ${{ join('platform=iOS Simulator,name=', env.simulator) }} -skip-testing:RunnerUITests | xcpretty

- name: Run iOS smoke tests
working-directory: auth0_flutter/example/ios
run: xcodebuild test -scheme Runner -workspace Runner.workspace -destination ${{ join('platform=iOS Simulator,name=', env.simulator) }} -only-testing:RunnerUITests | xcpretty

- name: Cancel wokflow on failure
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1
if: ${{ failure() }}

0 comments on commit ece36d9

Please sign in to comment.