Merge pull request #206 from sparcs-kaist/chore@version-2.5.0 #251
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: Test | |
on: | |
push: | |
branches: [main] | |
env: | |
FLUTTER_VERSION: "3.24.x" | |
JAVA_VERSION: "17" | |
ANDROID_API_LEVEL: "34" | |
XCODE_VERSION: "Xcode_16" | |
IOS_DEVICE: "iPhone 15 Pro" | |
jobs: | |
unit: | |
name: Unit & Widget Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Test | |
run: flutter test | |
integration-android: | |
if: false | |
name: Integration Test on Android | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "adopt" | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: "stable" | |
- name: Enable KVM group perms | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- name: Test on Android | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ env.ANDROID_API_LEVEL }} | |
script: flutter drive -d emulator-5554 --target=test_driver/app.dart | |
integration-ios: | |
name: Integration Test on iOS | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Select Xcode version | |
run: sudo xcode-select -s '/Applications/${{ env.XCODE_VERSION }}.app/Contents/Developer' | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: "stable" | |
- uses: actions/cache@v4 | |
with: | |
path: Pods | |
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pods- | |
- name: List Simulator | |
run: echo "UDID=$(xcrun xctrace list devices 2>&1 | awk '/${{ env.IOS_DEVICE }}/ {print $NF; exit}' | tr -d '()')" >> $GITHUB_ENV | |
- name: Start Simulator | |
run: xcrun simctl boot ${{ env.UDID }} | |
- name: Test on iOS | |
run: "flutter drive --target=test_driver/app.dart" | |
- name: Quit iOS Simulators | |
run: xcrun simctl shutdown all |