Skip to content

PSG-5764: npm packages updated #61

PSG-5764: npm packages updated

PSG-5764: npm packages updated #61

name: Integration Tests
on:
pull_request:
branches: [ "main" ]
jobs:
web-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.1'
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: |
cd proxy-server
npm install
cd ../..
flutter pub get
working-directory: ./integrationtestapp
- name: Set up Chrome Dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
libglib2.0-0 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 \
libgtk-3-0 libgbm-dev libnss3-dev libxss-dev libasound2t64 \
xvfb fonts-liberation libu2f-udev xdg-utils
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gconf/libgconf-2-4_3.2.6-6ubuntu1_amd64.deb
sudo dpkg -i libgconf-2-4_3.2.6-6ubuntu1_amd64.deb || true
sudo apt-get install -f -y
- name: Set up Google Chrome and ChromeDriver
uses: browser-actions/setup-chrome@v1
with:
chrome-version: 131
install-chromedriver: true
install-dependencies: false
- name: Start Xvfb
run: |
sudo apt-get install -y xvfb
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
- name: Start ChromeDriver
run: |
nohup chromedriver --port=4444 &
sleep 5
- name: Start Proxy Server
run: |
nohup node integrationtestapp/proxy-server/proxy_server.js &
sleep 5
env:
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}
- name: Run Web tests with XVFB
run: |
for test in integration_test/*.dart; do
xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" flutter drive --driver=test_driver/integration_test.dart --target=$test -d chrome --web-port=4200 --dart-define=MAILOSAUR_API_KEY=${{ secrets.MAILOSAUR_API_KEY }}
done
working-directory: ./integrationtestapp
env:
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}
android-tests:
runs-on: ubuntu-latest
needs: web-tests
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 }}