Skip to content

Handle errors from backend #118

Handle errors from backend

Handle errors from backend #118

Workflow file for this run

name: ci
on: pull_request
jobs:
analyze:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Set Flutter version from FVM config file to environment variables
uses: kuhnroyal/flutter-fvm-config-action@e91317131a2da710b9cd9b7a24f2c0ade9eeb61d
- uses: subosito/flutter-action@main
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
- name: Analyze
run: flutter analyze
# Since custom_lint can't run with "flutter analyze", we need to run it
# separately.
#
# See: https://pub.dev/packages/custom_lint#obtaining-the-list-of-lints-in-the-ci
custom-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Set Flutter version from FVM config file to environment variables
uses: kuhnroyal/flutter-fvm-config-action@e91317131a2da710b9cd9b7a24f2c0ade9eeb61d
- uses: subosito/flutter-action@main
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
- name: Custom Lint
run: dart run custom_lint
format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Install Dart
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: beta
- name: Install Prettier
run: npm install --global [email protected]
- name: Format (Dart)
run: dart format --set-exit-if-changed $(find lib -name "*.dart" -not \( -name "*.*freezed.dart" -o -name "*.*g.dart" \) )
- name: Format (Prettier)
run: prettier . --check
test:
# We need to use macOS because of the golden tests, see
# https://github.com/flutter/flutter/issues/36667#issuecomment-521335243.
runs-on: macos-12
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Set Flutter version from FVM config file to environment variables
uses: kuhnroyal/flutter-fvm-config-action@e91317131a2da710b9cd9b7a24f2c0ade9eeb61d
- uses: subosito/flutter-action@main
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
- name: Test
run: flutter test
# Uploads the results of failed tests as .zip to GitHub.
#
# You can find the file under the "Summary" Tab on GitHub when all jobs of
# this workflows finished.
- name: Upload failed golden tests
if: failure()
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
with:
name: failed-golden-tests
# When a golden test failed, are the results stored in the "failures"
# folder. The failures can be at several places, like in the app
# folder and in different packages.
path: "**/failures/*.png"
# We ignore it when no files could be found because the test command
# could also be failed because of an unit test. In this case there
# would be no failed golden test to upload.
if-no-files-found: ignore
app-preview:
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}"
runs-on: ubuntu-22.04
permissions:
pull-requests: write # for FirebaseExtended/action-hosting-deploy to comment on PRs
checks: write # for FirebaseExtended/action-hosting-deploy to comment on PRs
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Set Flutter version from FVM config file to environment variables
uses: kuhnroyal/flutter-fvm-config-action@e91317131a2da710b9cd9b7a24f2c0ade9eeb61d
- uses: subosito/flutter-action@main
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
- name: Build
run: |
flutter build web \
--web-renderer canvaskit \
--dart-define=RELEASE_DATE="$(date +"%B %e %Y")" \
--dart-define=FLAVOR="dev"
- uses: FirebaseExtended/action-hosting-deploy@120e124148ab7016bec2374e5050f15051255ba2
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ANKIGPT_PROD }}"
projectId: ankigpt-prod