forked from eatvio/eatvio_app
59 lines
2.2 KiB
YAML
59 lines
2.2 KiB
YAML
name: Eatvio App Android Test on custom docker
|
|
|
|
on: [ pull_request ]
|
|
|
|
env:
|
|
flutter_version: "3.29.1"
|
|
java_version: "21.x"
|
|
flutter_channel: "stable"
|
|
my_local_cache_dir: "/opt/hostedtoolcache/"
|
|
ANDROID_SDK_ROOT: "/opt/hostedtoolcache/Android/Sdk"
|
|
PUB_CACHE: "/opt/hostedtoolcache/.pub-cache"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: [ dev-office-flutter ]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Android environment variables
|
|
id: "android-env-setup"
|
|
run: |
|
|
echo "ANDROID_SDK_ROOT=${{ env.my_local_cache_dir }}Android/Sdk" >> $GITHUB_ENV
|
|
echo "PATH=$PATH:${{ env.my_local_cache_dir }}Android/Sdk/cmdline-tools/latest/bin:${{ env.my_local_cache_dir }}Android/Sdk/platform-tools:${{ env.my_local_cache_dir }}Android/Sdk/build-tools/30.0.3:${{ env.my_local_cache_dir }}Android/Sdk/build-tools/34.0.0" >> $GITHUB_ENV
|
|
echo "ANDROID_HOME=${{ env.my_local_cache_dir }}Android/Sdk" >> $GITHUB_ENV
|
|
|
|
- name: Fix dir permissions
|
|
run: |
|
|
git config --global --add safe.directory /opt/hostedtoolcache/flutter/${{ env.flutter_channel }}-${{ env.flutter_version }}-${{ steps.flutter-action.outputs.ARCHITECTURE }}
|
|
flutter config --android-sdk="$ANDROID_HOME"
|
|
flutter doctor -v
|
|
|
|
- name: Get dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Native Analyze
|
|
run: flutter analyze
|
|
|
|
- name: Test
|
|
run: flutter test
|
|
|
|
# - name: Build apk
|
|
# run: flutter build apk
|
|
# some test 2
|
|
|
|
# - name: Rename and move apk
|
|
# run: |
|
|
# TIMESTAMP=$(TZ=Europe/Moscow date +'%Y-%m-%d-%H-%M')
|
|
# APK_NAME="eatvio_app_${TIMESTAMP}.apk"
|
|
# mv build/app/outputs/flutter-apk/app-release.apk $APK_NAME
|
|
# echo "APK build finished $APK_NAME"
|
|
# echo "APK_NAME=$APK_NAME" >> $GITHUB_ENV
|
|
|
|
# - name: Upload APK artifact
|
|
# uses: actions/upload-artifact@v3
|
|
# with:
|
|
# name: ${{ env.APK_NAME }}
|
|
# path: ${{ env.APK_NAME }}
|