Add Codecov steps to iOS job #41
Workflow file for this run
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: CI | |
on: push | |
env: | |
flutter-version: '3.x' | |
jobs: | |
authorize: | |
name: Authorize | |
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }} | |
runs-on: ubuntu-latest | |
steps: | |
- run: true | |
analyze: | |
name: Analyze Flutter packages | |
needs: authorize | |
runs-on: ubuntu-latest | |
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: Add example/.env | |
working-directory: auth0_flutter | |
run: cp example/.env.example example/.env | |
- name: Analize auth0_flutter package | |
working-directory: auth0_flutter | |
run: flutter analyze | |
- name: Analize auth0_flutter_platform_interface package | |
working-directory: auth0_flutter_platform_interface | |
run: flutter analyze | |
test-flutter: | |
name: Test Flutter packages | |
needs: authorize | |
runs-on: ubuntu-latest | |
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: Add example/.env | |
working-directory: auth0_flutter | |
run: cp example/.env.example example/.env | |
- name: Test auth0_flutter package | |
working-directory: auth0_flutter | |
run: | | |
flutter test --tags browser --platform chrome | |
flutter test --coverage --exclude-tags browser | |
- name: Test auth0_flutter_platform_interface package | |
working-directory: auth0_flutter_platform_interface | |
run: flutter test --coverage | |
- name: Upload coverage report for auth0_flutter | |
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d | |
with: | |
name: Auth0 Flutter | |
flags: auth0_flutter | |
files: ./auth0_flutter/coverage/lcov.info | |
- name: Upload coverage report for auth0_flutter_platform_interface | |
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d | |
with: | |
name: Auth0 Flutter | |
flags: auth0_flutter_platform_interface | |
files: ./auth0_flutter_platform_interface/coverage/lcov.info | |
test-ios: | |
name: Test native iOS code using Xcode ${{ matrix.xcode }} | |
needs: authorize | |
runs-on: macos-latest | |
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }} | |
env: | |
xcode: '14.2' | |
simulator: iPhone 14 | |
USER_EMAIL: ${{ secrets.USER_EMAIL }} | |
USER_PASSWORD: ${{ secrets.USER_PASSWORD }} | |
strategy: | |
matrix: | |
xcode: | |
- '14.2' | |
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: Install Flutter dependencies | |
working-directory: auth0_flutter/example | |
run: flutter pub get | |
- name: Set Ruby version | |
working-directory: auth0_flutter/example/ios | |
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: Setup Xcode | |
run: sudo xcode-select --switch /Applications/Xcode_${{ env.xcode }}.app/Contents/Developer | |
- name: Save Xcode version | |
run: xcodebuild -version | tee .xcode-version | |
- id: restore-pods-cache | |
name: Restore Pods cache | |
uses: actions/cache@f5ce41475b483ad7581884324a6eca9f48f8dcc7 | |
with: | |
path: auth0_flutter/example/ios/Pods | |
key: pods-${{ hashFiles('Podfile.lock') }}-${{ hashFiles('.xcode-version') }}-v1 | |
- name: Install pods | |
working-directory: auth0_flutter/example/ios | |
run: pod install | |
- name: Set .env | |
working-directory: auth0_flutter/example | |
run: printf '%s\n%s\n%s' 'AUTH0_DOMAIN=${{ vars.AUTH0_DOMAIN }}' 'AUTH0_CLIENT_ID=${{ vars.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.xcworkspace -destination '${{ format('{0}{1}', 'platform=iOS Simulator,name=', env.simulator) }}' -resultBundlePath unit-tests.xcresult -skip-testing:RunnerUITests | |
- 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 '${{ format('{0}{1}', 'platform=iOS Simulator,name=', env.simulator) }}' -resultBundlePath smoke-tests.xcresult -only-testing:RunnerUITests | |
- name: Convert coverage report | |
working-directory: auth0_flutter/example/ios | |
run: bundle exec slather coverage -x --scheme Runner Runner.xcodeproj | |
- name: Upload coverage report | |
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d | |
with: | |
working-directory: auth0_flutter/example/ios | |
- name: Upload xcresult bundles | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce | |
if: ${{ failure() }} | |
with: | |
name: xcresult bundles | |
path: 'auth0_flutter/example/ios/*.xcresult' |