diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d938ce03..b476bb73 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: build_and_deploy_ios: runs-on: [macos-latest] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Install RubyGems run: | cd example/ios @@ -24,35 +24,63 @@ jobs: run: | cd example flutter pub get - flutter build ios --release --no-codesign + - name: Coverage fix + run: | + file=test/coverage_helper_test.dart + echo "// Helper file to make coverage work for all dart files\n" > $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 + echo "" >> $file + echo "void main(){}" >> $file + cat $file + - name: Run tests + run: flutter test --coverage + - name: Codecov + run: bash <(curl -s https://codecov.io/bash) -c -t ${{ secrets.CODECOV_TOKEN }} -f coverage/lcov.info -F flutter_tool - name: Build and release env: MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} run: | + cd example + flutter build ios --release --no-codesign cd example/ios bundle exec fastlane deploy_to_firebase build_and_deploy_android: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Flutter action - uses: subosito/flutter-action@v1.3.2 - with: - channel: 'stable' - - name: Get dependencies - run: flutter pub get - - name: Coverage fix - run: | - file=test/coverage_helper_test.dart - echo "// Helper file to make coverage work for all dart files\n" > $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 - echo "" >> $file - echo "void main(){}" >> $file - cat $file - - name: Run tests - run: flutter test --coverage - - name: Codecov - run: bash <(curl -s https://codecov.io/bash) -c -t ${{ secrets.CODECOV_TOKEN }} -f coverage/lcov.info -F flutter_tool + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: '12.x' + - uses: subosito/flutter-action@v1.3.2 + with: + channel: 'stable' + - run: | + cd example + flutter pub get + - name: Coverage fix + run: | + file=test/coverage_helper_test.dart + echo "// Helper file to make coverage work for all dart files\n" > $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 + echo "" >> $file + echo "void main(){}" >> $file + cat $file + - name: Run tests + run: flutter test --coverage + - name: Codecov + run: bash <(curl -s https://codecov.io/bash) -c -t ${{ secrets.CODECOV_TOKEN }} -f coverage/lcov.info -F flutter_tool + - name: Build + run: | + cd example + flutter build apk + - name: Deploy + uses: wzieba/Firebase-Distribution-Github-Action@v1.2.1 + with: + appId: ${{secrets.FIREBASE_ANDROID_APPID}} + token: ${{secrets.FIREBASE_TOKEN}} + groups: stream-testers + file: example/build/app/outputs/apk/release/app-release.apk