forked from eatvio/eatvio_app
ci(tests): tests added
This commit is contained in:
@@ -33,7 +33,7 @@ jobs:
|
|||||||
uses: actions/flutter-action@v2
|
uses: actions/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: ${{ env.flutter_channel }}
|
channel: ${{ env.flutter_channel }}
|
||||||
flutter-version: ${{ env.flutter_version }}
|
flutter-version: ${{ env.flutter_version }}
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: show cache keys
|
- name: show cache keys
|
||||||
@@ -49,7 +49,7 @@ jobs:
|
|||||||
|
|
||||||
- name: fix dir permissions
|
- name: fix dir permissions
|
||||||
run: |
|
run: |
|
||||||
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.19.0-x64
|
git config --global --add safe.directory /opt/hostedtoolcache/flutter/${{ env.flutter_channel }}-${{ env.flutter_version }}-${{ steps.flutter-action.outputs.ARCHITECTURE }}
|
||||||
flutter --version
|
flutter --version
|
||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
@@ -64,8 +64,8 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
touch .env
|
touch .env
|
||||||
flutter test --coverage
|
flutter test
|
||||||
|
|
||||||
# - name: Build apk
|
# - name: Build apk
|
||||||
# run: flutter build apk
|
# run: flutter build apk
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
name: Eatvio App Test
|
name: Eatvio App Android Test
|
||||||
|
|
||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
flutter_version: "3.19.0"
|
flutter_version: "3.19.0"
|
||||||
java_version: "12.x"
|
java_version: "12.x"
|
||||||
|
flutter_channel: "stable"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -12,6 +13,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ runner.tool_cache }}/flutter
|
||||||
|
key: flutter-${{ env.flutter_version }}-${{ env.flutter_channel }}
|
||||||
|
|
||||||
- name: Install jq
|
- name: Install jq
|
||||||
run: |
|
run: |
|
||||||
@@ -21,25 +26,15 @@ jobs:
|
|||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: "zulu"
|
distribution: "zulu"
|
||||||
java-version: ${{ env.java_version }}
|
java-version: "12.x"
|
||||||
cache: "gradle"
|
cache: "gradle"
|
||||||
|
|
||||||
- name: Cache Flutter dependencies
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: /opt/hostedtoolcache/flutter
|
|
||||||
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
|
|
||||||
|
|
||||||
- id: flutter-action
|
- id: flutter-action
|
||||||
uses: actions/flutter-action@v2
|
uses: actions/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: "stable"
|
channel: ${{ env.flutter_channel }}
|
||||||
flutter-version: ${{ env.flutter_version }}
|
flutter-version: ${{ env.flutter_version }}
|
||||||
cache: true
|
cache: true
|
||||||
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
|
|
||||||
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
|
|
||||||
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
|
|
||||||
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
|
|
||||||
|
|
||||||
- name: show cache keys
|
- name: show cache keys
|
||||||
run: |
|
run: |
|
||||||
@@ -54,17 +49,19 @@ jobs:
|
|||||||
|
|
||||||
- name: fix dir permissions
|
- name: fix dir permissions
|
||||||
run: |
|
run: |
|
||||||
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.19.0-x64
|
git config --global --add safe.directory /opt/hostedtoolcache/flutter/${{ env.flutter_channel }}-${{ env.flutter_version }}-${{ steps.flutter-action.outputs.ARCHITECTURE }}
|
||||||
flutter --version
|
flutter --version
|
||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
||||||
|
- name: Native Analyze
|
||||||
|
run: flutter analyze
|
||||||
|
|
||||||
- name: Run Code Metrics
|
- name: Run Code Metrics
|
||||||
run: flutter pub run dart_code_metrics:metrics lib --disable-sunset-warning --fatal-warnings --fatal-performance
|
run: flutter pub run dart_code_metrics:metrics lib --disable-sunset-warning --fatal-warnings --fatal-performance
|
||||||
# - name: Build apk
|
|
||||||
# run: flutter build apk
|
|
||||||
|
|
||||||
# Runs a set of commands using the runners shell
|
- name: Test
|
||||||
# - name: Start release build
|
run: |
|
||||||
# run: flutter build appbundle
|
touch .env
|
||||||
|
flutter test
|
||||||
|
|||||||
Reference in New Issue
Block a user