Skip to content

Version and tests check #19

Version and tests check

Version and tests check #19

#WORKING_BRANCH_VERSION="${{ env.WORKING_BRANCH_VERSION }}"
name: Version and tests check
run-name: Version and tests check
on:
pull_request:
branches:
- dev
jobs:
app-version-check:
runs-on: ubuntu-20.04
steps:
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@main
with:
ref: dev
- name: Extract version from branch DEV
run: |
chmod -R 777 scripts
DEV_BRANCH_VERSION="$(./scripts/version.sh)"
echo "DEV_BRANCH_VERSION=$DEV_BRANCH_VERSION" >> $GITHUB_ENV
echo "DEV_BRANCH_VERSION: $DEV_BRANCH_VERSION"
- uses: actions/checkout@main
- name: Extract version from branch WORKING
run: |
chmod -R 777 scripts
WORKING_BRANCH_VERSION="$(./scripts/version.sh)"
echo "WORKING_BRANCH_VERSION=$WORKING_BRANCH_VERSION" >> $GITHUB_ENV
echo "WORKING_BRANCH_VERSION: $WORKING_BRANCH_VERSION"
- name: Compare versions
run: |
echo "DEV_BRANCH_VERSION: $DEV_BRANCH_VERSION"
echo "WORKING_BRANCH_VERSION: $WORKING_BRANCH_VERSION"
RESULT="$(./scripts/compare_versions.py $DEV_BRANCH_VERSION $WORKING_BRANCH_VERSION)"
if [ $RESULT == "True" ]; then
exit 0
fi
echo "Working branch version isn't updated in file pubspec.yaml. Please update accordingly."
exit 1
run-unit-tests:
needs: app-version-check
runs-on: ubuntu-20.04
steps:
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@main
# https://github.com/marketplace/actions/flutter-action
- name: Extract flutter SDK version from FVM
run: echo "FLUTTER_SDK_VERSION=$(jq -r '.flutterSdkVersion' .fvm/fvm_config.json)" >> $GITHUB_ENV
- uses: subosito/flutter-action@main
with:
flutter-version: ${{ env.FLUTTER_SDK_VERSION }}
channel: stable
- run: flutter pub get
- run: flutter analyze
- run: flutter test "test/unit" --platform chrome --null-assertions