update actions
This commit is contained in:
+55
-27
@@ -10,7 +10,7 @@ on:
|
|||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- created
|
- created
|
||||||
|
|
||||||
env:
|
env:
|
||||||
flutter_version: "1.12.13+hotfix.5"
|
flutter_version: "1.12.13+hotfix.5"
|
||||||
|
|
||||||
@@ -18,29 +18,57 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: [ubuntu-latest]
|
runs-on: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Cache Flutter dependencies
|
- name: Cache Flutter dependencies
|
||||||
id: cache
|
id: cache
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: /opt/hostedtoolcache/flutter
|
path: /opt/hostedtoolcache/flutter
|
||||||
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
|
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
|
||||||
- name: Flutter action
|
- name: Flutter action
|
||||||
uses: subosito/[email protected]
|
uses: subosito/[email protected]
|
||||||
with:
|
with:
|
||||||
flutter-version: ${{ env.flutter_version }}
|
flutter-version: ${{ env.flutter_version }}
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
- name: Coverage fix
|
- name: Coverage fix
|
||||||
run: |
|
run: |
|
||||||
file=test/coverage_helper_test.dart
|
file=test/coverage_helper_test.dart
|
||||||
echo "// Helper file to make coverage work for all dart files\n" > $file
|
echo "// Helper file to make coverage work for all dart files\n" > $file
|
||||||
echo "// ignore_for_file: unused_import" >> $file
|
echo "// ignore_for_file: unused_import" >> $file
|
||||||
find lib -name '*.dart' | grep -e '[^g]\.dart' | grep -v '_html.dart' | cut -c4- | awk -v package=stream_chat_flutter '{printf "import '\''package:%s%s'\'';\n", package, $1}' >> $file
|
find lib -name '*.dart' | grep -e '[^g]\.dart' | grep -v '_html.dart' | cut -c4- | awk -v package=stream_chat_flutter '{printf "import '\''package:%s%s'\'';\n", package, $1}' >> $file
|
||||||
echo "" >> $file
|
echo "" >> $file
|
||||||
echo "void main(){}" >> $file
|
echo "void main(){}" >> $file
|
||||||
cat $file
|
cat $file
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: flutter test --coverage
|
run: flutter test --coverage
|
||||||
- name: Codecov
|
- name: Codecov
|
||||||
run: bash <(curl -s https://codecov.io/bash) -c -t ${{ secrets.CODECOV_TOKEN }} -f coverage/lcov.info -F flutter_tool
|
run: bash <(curl -s https://codecov.io/bash) -c -t ${{ secrets.CODECOV_TOKEN }} -f coverage/lcov.info -F flutter_tool
|
||||||
|
build_and_deploy:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: '12.x'
|
||||||
|
- uses: subosito/[email protected]
|
||||||
|
with:
|
||||||
|
flutter-version: ${{ env.flutter_version }}
|
||||||
|
- run: flutter pub get
|
||||||
|
- name: Build
|
||||||
|
run: flutter build apk
|
||||||
|
- name: Upload
|
||||||
|
uses: actions/upload-artifact@master
|
||||||
|
with:
|
||||||
|
name: apk-build
|
||||||
|
path: example/build/app/outputs/bundle/release
|
||||||
|
- name: Deploy
|
||||||
|
#if: github.base_ref == 'master'
|
||||||
|
uses: wzieba/[email protected]
|
||||||
|
with:
|
||||||
|
appId: ${{secrets.FIREBASE_ANDROID_APPID}}
|
||||||
|
token: ${{secrets.FIREBASE_TOKEN}}
|
||||||
|
groups: stream-testers
|
||||||
|
file: example/build/app/outputs/apk/release/app-release.apk
|
||||||
|
|||||||
Reference in New Issue
Block a user