-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (54 loc) · 2.07 KB
/
version_and_tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#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