PSG-5751: NPM packages updated #56
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: Integration Tests | |
on: | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
android-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.22.1' | |
- name: Enable KVM | |
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: Install Android Command Line Tools | |
run: | | |
mkdir -p $HOME/android-sdk/cmdline-tools | |
curl -o commandlinetools.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip | |
unzip commandlinetools.zip -d $HOME/android-sdk/cmdline-tools | |
mv $HOME/android-sdk/cmdline-tools/cmdline-tools $HOME/android-sdk/cmdline-tools/latest | |
echo "export ANDROID_HOME=$HOME/android-sdk" >> $GITHUB_ENV | |
echo "export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH" >> $GITHUB_ENV | |
echo "export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools" >> $GITHUB_PATH | |
- name: Accept SDK Licenses and Install Tools | |
run: | | |
yes | sdkmanager --licenses | |
sdkmanager "platform-tools" "platforms;android-35" "system-images;android-35;google_apis;x86_64" | |
- name: Install dependencies | |
run: flutter pub get | |
working-directory: ./integrationtestapp | |
- name: Set environment variables | |
env: | |
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }} | |
run: | | |
echo "export MAILOSAUR_API_KEY=${{ secrets.MAILOSAUR_API_KEY }}" >> $GITHUB_ENV | |
- name: Start emulator and run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 35 | |
target: google_apis | |
arch: x86_64 | |
profile: Nexus 6 | |
force-avd-creation: true | |
emulator-boot-timeout: 600 | |
working-directory: ./integrationtestapp | |
script: flutter test integration_test/*.dart -d emulator-5554 --dart-define=MAILOSAUR_API_KEY=${{ secrets.MAILOSAUR_API_KEY }} | |
ios-tests: | |
runs-on: macos-latest | |
needs: android-tests | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Xcode 15.4 | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15.4' | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.22.1' | |
- name: Install dependencies | |
run: flutter pub get | |
working-directory: ./integrationtestapp | |
- name: Install CocoaPods | |
run: pod install --project-directory=ios | |
working-directory: ./integrationtestapp | |
- name: Install simulator | |
id: install-simulator | |
uses: futureware-tech/simulator-action@v3 | |
with: | |
model: 'iPhone 15' | |
- name: Run iOS tests | |
run: flutter test integration_test/*.dart -d ${{ steps.install-simulator.outputs.udid }} --dart-define=MAILOSAUR_API_KEY=${{ secrets.MAILOSAUR_API_KEY }} | |
working-directory: ./integrationtestapp | |
env: | |
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }} |