今のtoastのPackagesをシンプルなものにしてみました #1060
Workflow file for this run
This file contains hidden or 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: test | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: [ opened, synchronize ] | |
| push: | |
| branches: | |
| - main | |
| env: | |
| FLUTTER_VERSION: '3.10.2' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - name: Setup Flutter cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ${{ steps.fvm-config-action.outputs.FVM_HOME }} | |
| .dart_tool | |
| .pub-cache | |
| key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-flutter- | |
| - name: Create environment files | |
| env: | |
| APP_ENV: ${{ secrets.APP_ENV }} | |
| DEV_ENV: ${{ secrets.DEV_ENV }} | |
| PROD_ENV: ${{ secrets.PROD_ENV }} | |
| ANDROID_CONFIG: ${{ secrets.ANDROID_CONFIG }} | |
| FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} | |
| run: | | |
| set +x | |
| if [ -z "$APP_ENV" ] || [ -z "$DEV_ENV" ] || [ -z "$PROD_ENV" ]; then | |
| echo "Error: One or more environment secrets are empty" | |
| exit 1 | |
| fi | |
| # 環境ファイルの作成(Base64デコードして直接使用) | |
| echo $APP_ENV | base64 --decode > .env | |
| echo $DEV_ENV | base64 --decode > .env.dev | |
| echo $PROD_ENV | base64 --decode > .env.prod | |
| # Android設定ファイルの作成(JSON形式から) | |
| if [ -n "$ANDROID_CONFIG" ]; then | |
| echo $ANDROID_CONFIG | base64 --decode > android_config.json | |
| GOOGLE_MAPS_API_KEY=$(jq -r '.googleMapsApiKey' android_config.json) | |
| KEYSTORE_PASSWORD=$(jq -r '.keystorePassword' android_config.json) | |
| KEY_PASSWORD=$(jq -r '.keyPassword' android_config.json) | |
| KEY_ALIAS=$(jq -r '.keyAlias' android_config.json) | |
| KEYSTORE_FILE_PATH=$(jq -r '.keystoreFilePath' android_config.json) | |
| echo "# Android機密情報設定" > android/secret.properties | |
| echo "googleMap.apiKey=$GOOGLE_MAPS_API_KEY" >> android/secret.properties | |
| echo "# キーストア設定" > android/key.properties | |
| echo "storePassword=$KEYSTORE_PASSWORD" >> android/key.properties | |
| echo "keyPassword=$KEY_PASSWORD" >> android/key.properties | |
| echo "keyAlias=$KEY_ALIAS" >> android/key.properties | |
| echo "storeFile=$KEYSTORE_FILE_PATH" >> android/key.properties | |
| rm android_config.json | |
| fi | |
| # ファイルの権限を設定 | |
| chmod 600 .env .env.dev .env.prod android/secret.properties android/key.properties | |
| - name: Create Firebase configuration | |
| env: | |
| FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} | |
| run: | | |
| # Firebase設定ファイルの作成(JSON形式から) | |
| if [ -n "$FIREBASE_CONFIG" ]; then | |
| echo $FIREBASE_CONFIG | base64 --decode > firebase_config.json | |
| FIREBASE_ANDROID_API_KEY=$(jq -r '.android.apiKey' firebase_config.json) | |
| FIREBASE_ANDROID_APP_ID=$(jq -r '.android.appId' firebase_config.json) | |
| FIREBASE_IOS_API_KEY=$(jq -r '.ios.apiKey' firebase_config.json) | |
| FIREBASE_IOS_APP_ID=$(jq -r '.ios.appId' firebase_config.json) | |
| FIREBASE_MESSAGING_SENDER_ID=$(jq -r '.messagingSenderId' firebase_config.json) | |
| FIREBASE_PROJECT_ID=$(jq -r '.projectId' firebase_config.json) | |
| FIREBASE_DATABASE_URL=$(jq -r '.databaseUrl' firebase_config.json) | |
| FIREBASE_STORAGE_BUCKET=$(jq -r '.storageBucket' firebase_config.json) | |
| FIREBASE_ANDROID_CLIENT_ID=$(jq -r '.android.clientId' firebase_config.json) | |
| FIREBASE_IOS_BUNDLE_ID=$(jq -r '.ios.bundleId' firebase_config.json) | |
| cat > lib/firebase_options.dart << EOF | |
| // File generated by FlutterFire CLI. | |
| // ignore_for_file: type=lint | |
| import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; | |
| import 'package:flutter/foundation.dart' | |
| show defaultTargetPlatform, kIsWeb, TargetPlatform; | |
| class DefaultFirebaseOptions { | |
| static FirebaseOptions get currentPlatform { | |
| if (kIsWeb) { | |
| throw UnsupportedError( | |
| 'DefaultFirebaseOptions have not been configured for web - ' | |
| 'you can reconfigure this by running the FlutterFire CLI again.', | |
| ); | |
| } | |
| switch (defaultTargetPlatform) { | |
| case TargetPlatform.android: | |
| return android; | |
| case TargetPlatform.iOS: | |
| return ios; | |
| case TargetPlatform.macOS: | |
| throw UnsupportedError( | |
| 'DefaultFirebaseOptions have not been configured for macos - ' | |
| 'you can reconfigure this by running the FlutterFire CLI again.', | |
| ); | |
| case TargetPlatform.windows: | |
| throw UnsupportedError( | |
| 'DefaultFirebaseOptions have not been configured for windows - ' | |
| 'you can reconfigure this by running the FlutterFire CLI again.', | |
| ); | |
| case TargetPlatform.linux: | |
| throw UnsupportedError( | |
| 'DefaultFirebaseOptions have not been configured for linux - ' | |
| 'you can reconfigure this by running the FlutterFire CLI again.', | |
| ); | |
| default: | |
| throw UnsupportedError( | |
| 'DefaultFirebaseOptions are not supported for this platform.', | |
| ); | |
| } | |
| } | |
| static const FirebaseOptions android = FirebaseOptions( | |
| apiKey: '$FIREBASE_ANDROID_API_KEY', | |
| appId: '$FIREBASE_ANDROID_APP_ID', | |
| messagingSenderId: '$FIREBASE_MESSAGING_SENDER_ID', | |
| projectId: '$FIREBASE_PROJECT_ID', | |
| databaseURL: '$FIREBASE_DATABASE_URL', | |
| storageBucket: '$FIREBASE_STORAGE_BUCKET', | |
| ); | |
| static const FirebaseOptions ios = FirebaseOptions( | |
| apiKey: '$FIREBASE_IOS_API_KEY', | |
| appId: '$FIREBASE_IOS_APP_ID', | |
| messagingSenderId: '$FIREBASE_MESSAGING_SENDER_ID', | |
| projectId: '$FIREBASE_PROJECT_ID', | |
| databaseURL: '$FIREBASE_DATABASE_URL', | |
| storageBucket: '$FIREBASE_STORAGE_BUCKET', | |
| androidClientId: '$FIREBASE_ANDROID_CLIENT_ID', | |
| iosBundleId: '$FIREBASE_IOS_BUNDLE_ID', | |
| ); | |
| } | |
| EOF | |
| rm firebase_config.json | |
| fi | |
| - name: fvm | |
| uses: kuhnroyal/flutter-fvm-config-action@0b792d004e2dfeda282a7af5c0609703658a9f8b # v3.1 | |
| id: fvm-config-action | |
| - name: install flutter | |
| uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2.19.0 | |
| with: | |
| flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | |
| channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} | |
| - name: Debug dependencies | |
| run: | | |
| flutter pub deps | |
| - name: Clear Flutter cache | |
| run: | | |
| flutter pub cache repair | |
| - name: Install dependencies | |
| run: | | |
| flutter pub get | |
| flutter pub upgrade | |
| - name: build runner | |
| run: | | |
| flutter pub run build_runner build --delete-conflicting-outputs | |
| - name: Test | |
| run: | | |
| flutter test --coverage || { echo "Test failed"; exit 1; } | |
| env: | |
| FLUTTER_TEST_REPORTER: json |