-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'chore/dependabot' into feature/macos-support
- Loading branch information
Showing
5 changed files
with
234 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Set up iOS/macOS environment | ||
description: Set up the environment for building and testing the library on iOS/macOS | ||
|
||
inputs: | ||
platform: | ||
description: Either iOS or macOS | ||
required: true | ||
|
||
flutter: | ||
description: The version of Flutter to use | ||
required: true | ||
|
||
xcode: | ||
description: The version of Xcode to use | ||
required: true | ||
|
||
auth0-domain: | ||
description: The Auth0 domain | ||
required: true | ||
|
||
auth0-client-id: | ||
description: The Auth0 client ID | ||
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: Install Flutter | ||
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa | ||
with: | ||
flutter-version: ${{ inputs.flutter }} | ||
channel: stable | ||
cache: true | ||
|
||
- name: Install Flutter dependencies | ||
working-directory: sample | ||
run: flutter pub get | ||
shell: bash | ||
|
||
- name: Set Ruby version | ||
working-directory: sample/${{ steps.lowercase-platform.outputs.platform }} | ||
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: sample/${{ steps.lowercase-platform.outputs.platform }} | ||
|
||
- name: Setup Xcode | ||
run: sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode }}.app/Contents/Developer | ||
shell: bash | ||
|
||
- name: Save Xcode version | ||
run: xcodebuild -version | tee .xcode-version | ||
shell: bash | ||
|
||
- id: restore-pods-cache | ||
name: Restore Pods cache | ||
uses: actions/cache@f5ce41475b483ad7581884324a6eca9f48f8dcc7 | ||
with: | ||
path: sample/${{ steps.lowercase-platform.outputs.platform }}/Pods | ||
key: pods-${{ hashFiles('Podfile.lock') }}-${{ hashFiles('.xcode-version') }}-v1 | ||
|
||
- name: Install pods | ||
working-directory: sample/${{ steps.lowercase-platform.outputs.platform }} | ||
run: pod install | ||
shell: bash | ||
|
||
- name: Set .env | ||
working-directory: sample | ||
run: printf '%s\n%s\n%s' 'AUTH0_DOMAIN=${{ inputs.auth0-domain }}' 'AUTH0_CLIENT_ID=${{ inputs.auth0-client-id }}' 'AUTH0_CUSTOM_SCHEME=demo' >> .env | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: sample/${{ 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: sample/${{ 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' | ||
path: 'sample/${{ steps.lowercase-platform.outputs.platform }}/smoke-tests.xcresult' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
permissions: {} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
env: | ||
flutter: '3.x' | ||
ios-simulator: iPhone 15 | ||
|
||
jobs: | ||
authorize: | ||
name: Authorize | ||
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: true | ||
|
||
analyze-dart: | ||
name: Analyze Dart code | ||
needs: authorize | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
|
||
- name: Install Flutter | ||
uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 | ||
with: | ||
flutter-version: ${{ env.flutter }} | ||
channel: stable | ||
cache: true | ||
|
||
- name: Add sample/.env | ||
working-directory: sample | ||
run: cp .env.example .env | ||
|
||
- name: Run Dart analyzer | ||
working-directory: sample | ||
run: flutter analyze | ||
|
||
test-dart: | ||
name: Test Dart code | ||
needs: authorize | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
|
||
- name: Install Flutter | ||
uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 | ||
with: | ||
flutter-version: ${{ env.flutter }} | ||
channel: stable | ||
cache: true | ||
|
||
- name: Add sample/.env | ||
working-directory: sample | ||
run: cp .env.example .env | ||
|
||
- name: Run Dart tests | ||
working-directory: sample | ||
run: flutter test | ||
|
||
test-ios-smoke: | ||
name: Run native iOS smoke tests using Xcode ${{ matrix.xcode }} | ||
needs: authorize | ||
runs-on: macos-13-large | ||
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }} | ||
|
||
env: | ||
platform: iOS | ||
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 iOS smoke tests | ||
uses: ./.github/actions/smoke-tests-darwin | ||
with: | ||
platform: ${{ env.platform }} | ||
destination: 'platform=iOS Simulator,name=iPhone 15' |
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
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