Clean architecture - Run tests (#105.1) - pull_request refs/pull/29/merge (from enhancement/clean-architecture to main) #105
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
run-name: > | |
${{ github.event.pull_request.title }} - ${{ github.workflow }} (#${{ github.run_number }}.${{ github.run_attempt }}) - ${{ github.event_name }} ${{ github.ref }} (from ${{ github.head_ref }} to ${{ github.base_ref }}) | |
on: | |
pull_request: | |
branches: [ main ] | |
merge_group: | |
types: [ checks_requested ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
flutter_version: '3.10.0' | |
java_version: '11' | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Flutter installation | |
uses: actions/cache@v3 | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: ${{ runner.os }}-flutter-install-cache-${{ env.flutter_version }} | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.flutter_version }} | |
channel: 'stable' | |
- name: Cache Flutter packages | |
uses: actions/cache@v3 | |
with: | |
path: | # get FLUTTER_ROOT from flutter-action | |
${{ env.FLUTTER_ROOT }}/.pub-cache | |
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pub-cache- | |
- run: flutter config --no-analytics | |
- name: Format code | |
run: dart format . --set-exit-if-changed | |
- name: Install dependencies | |
run: flutter pub get | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Flutter installation | |
uses: actions/cache@v3 | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: ${{ runner.os }}-flutter-install-cache-${{ env.flutter_version }} | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.flutter_version }} | |
channel: 'stable' | |
- name: Cache Flutter packages | |
uses: actions/cache@v3 | |
with: | |
path: | # get FLUTTER_ROOT from flutter-action | |
${{ env.FLUTTER_ROOT }}/.pub-cache | |
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pub-cache- | |
- run: flutter --version | |
- run: flutter config --no-analytics | |
- run: flutter pub get | |
- name: build the environment | |
env: | |
ANDROID_APP_ID: ${{ secrets.ANDROID_APP_ID }} | |
ANDROID_BANNER_ID: ${{ secrets.ANDROID_BANNER_ID }} | |
ANDROID_NATIVE_ID: ${{ secrets.ANDROID_NATIVE_ID }} | |
IOS_APP_ID: ${{ secrets.IOS_APP_ID }} | |
IOS_BANNER_ID: ${{ secrets.IOS_BANNER_ID }} | |
IOS_NATIVE_ID: ${{ secrets.IOS_NATIVE_ID }} | |
TEST_ADS: ${{ secrets.TEST_ADS }} | |
run: dart tool/env.dart | |
- name: Generate files (freezed, json_serializable) | |
run: flutter pub run build_runner build --delete-conflicting-outputs | |
- name: Activate flutter packages | |
run: | | |
flutter pub global activate intl_utils | |
- name: Generate translations | |
run: | | |
flutter pub global run intl_utils:generate | |
- name: Analyze code | |
run: flutter analyze --no-fatal-infos --fatal-warnings | |
- run: flutter test |