test #22
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 of your workflow. | |
name: flutter drive | |
# Trigger the workflow on push or pull request. | |
on: [push, pull_request] | |
# A workflow run is made up of one or more jobs. | |
jobs: | |
# id of job, a string that is unique to the "jobs" node above. | |
drive: | |
# Creates a build matrix for your jobs. You can define different | |
# variations of an environment to run each job in. | |
strategy: | |
# A set of different configurations of the virtual environment. | |
matrix: | |
device: | |
- "iPhone 8" | |
# - "iPhone 11 Pro Max (13.1)" | |
# When set to true, GitHub cancels all in-progress jobs if any matrix job | |
# fails. | |
fail-fast: false | |
# The type of machine to run the job on. | |
runs-on: macOS-latest | |
# Contains a sequence of tasks. | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set latest Xcode version | |
run: | | |
echo "Available Xcode versions:" | |
XCODE_PATH=$(ls /Applications | grep Xcode | sort -V | tail -n 1) | |
echo "Selected Xcode version: $XCODE_PATH" | |
sudo xcode-select -switch /Applications/$XCODE_PATH/Contents/Developer | |
- name: Print Xcode version | |
run: | | |
xcodebuild -version | |
- name: Check PATH and available tools | |
run: | | |
echo $PATH | |
ls $(xcode-select -p)/usr/bin | |
- name: Print instruments | |
run: | | |
xcrun simctl list devices | |
# A name for your step to display on GitHub. | |
# - name: "List all simulators" | |
# run: "xcrun instruments -s" | |
- name: "Start Simulator" | |
# run: | | |
# UDID=$( | |
# xcrun simctl -s | | |
# awk \ | |
# -F ' *[][]' \ | |
# -v 'device=${{ matrix.device }}' \ | |
# '$1 == device { print $2 }' | |
# ) | |
# xcrun simctl boot "${UDID:?No Simulator with this name found}" | |
# run: xcrun simctl boot 66A6B2F3-3C93-4F80-9B07-F5AA621210E7 | |
run: | | |
UUID=$(xcrun simctl list devices | grep -o "${{matrix.device}} ([A-Z0-9-]\+)" | awk -F '[()]' '{print $2}') | |
xcrun simctl boot CB43AD34-36FC-48B5-83D9-3F3BFFA255DC | |
# The branch or tag ref that triggered the workflow will be checked out. | |
# https://github.com/actions/checkout | |
- uses: actions/checkout@v3 | |
# Sets up a flutter environment. | |
# https://github.com/marketplace/actions/flutter-action | |
# - uses: subosito/flutter-action@v1 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.10.3' | |
channel: 'stable' | |
- run: flutter --version | |
- name: "Run Flutter Driver tests" | |
run: "flutter drive --target=test_driver/app.dart" |