-
Notifications
You must be signed in to change notification settings - Fork 133
Eval #781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
polina-c
wants to merge
12
commits into
flutter:main
Choose a base branch
from
polina-c:eval
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+133
−3
Draft
Eval #781
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e3c54df
-
polina-c 65c6189
Update smoke_test.dart
polina-c 9f7343b
-
polina-c a9f861f
Create eval.yaml
polina-c 3b678ac
-
polina-c fe8a7ff
Update pubspec.yaml
polina-c 33c1b58
Update eval.yaml
polina-c 12d791b
Update eval.yaml
polina-c 2fa640f
Update eval.yaml
polina-c 68caeed
Update eval.yaml
polina-c e0c5cab
Update eval.yaml
polina-c c2d1a21
Update eval.yaml
polina-c File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Copyright 2025 The Flutter Authors. | ||
| # Use of this source code is governed by a BSD-style license that can be | ||
| # found in the LICENSE file. | ||
|
|
||
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
|
|
||
| name: Eval CI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| schedule: | ||
| # Tests may fail due to new dependency releases. | ||
| # Regular execution provides early detection of such regressions. | ||
| - cron: '0 * * * *' # hourly | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| # Prevents the job from running on forks or fork PRs (which don't have access to secrets). | ||
| # if: github.repository == 'flutter/genui' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) | ||
| name: examples/eval (${{ matrix.flutter_version }}) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| flutter_version: [beta, stable] | ||
| os: [ubuntu-latest] | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 | ||
| with: | ||
| distribution: "zulu" | ||
| java-version: "17" | ||
| cache: "gradle" | ||
| - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 | ||
| with: | ||
| channel: ${{ matrix.flutter_version }} | ||
| cache: true | ||
| - name: check api key | ||
| run: echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }}" | ||
| - name: Print Flutter version | ||
| run: flutter --version | ||
| - name: Cache Pub dependencies | ||
| uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 | ||
| with: | ||
| path: ${{ env.PUB_CACHE }} | ||
| key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} | ||
| restore-keys: ${{ runner.os }}-pub- | ||
| - name: Install dependencies | ||
| working-directory: examples/eval | ||
| run: dart pub get | ||
| - name: Run tests | ||
| working-directory: examples/eval | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| run: flutter test --dart-define=GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }} |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Eval | ||
|
|
||
| Project for tests that evaluate genui against real AI models. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Copyright 2025 The Flutter Authors. | ||
| # Use of this source code is governed by a BSD-style license that can be | ||
| # found in the LICENSE file. | ||
|
|
||
| name: eval | ||
| publish_to: "none" | ||
|
|
||
| environment: | ||
| sdk: ">=3.10.0 <4.0.0" | ||
| flutter: ">=3.35.7 <4.0.0" | ||
|
|
||
| resolution: workspace | ||
|
|
||
| dependencies: | ||
| flutter: | ||
| sdk: flutter | ||
| genui: ^0.7.0 | ||
|
|
||
| dev_dependencies: | ||
| flutter_test: | ||
| sdk: flutter | ||
|
|
||
| flutter: | ||
| uses-material-design: true |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Copyright 2025 The Flutter Authors. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter_test/flutter_test.dart'; | ||
|
|
||
| import 'test_infra/io_get_api_key.dart'; | ||
|
|
||
| void main() { | ||
| test('smoke test', () { | ||
| final String key = apiKey(); | ||
| expect(key, isNotEmpty); | ||
| print('API Key: ${key.substring(0, 2)}...${key.substring(key.length - 2)}'); | ||
| }); | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // Copyright 2025 The Flutter Authors. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'dart:io'; | ||
|
|
||
| /// API key for Google Generative AI (only needed if using google backend). | ||
| /// Get an API key from https://aistudio.google.com/app/apikey | ||
| /// Specify this when running the app with "-D GEMINI_API_KEY=$GEMINI_API_KEY" | ||
| const String geminiApiKey = String.fromEnvironment('GEMINI_API_KEY'); | ||
|
|
||
| String apiKey() { | ||
| String apiKey = geminiApiKey.isEmpty | ||
| ? Platform.environment['GEMINI_API_KEY'] ?? '' | ||
| : geminiApiKey; | ||
| if (apiKey.isEmpty) { | ||
| throw Exception( | ||
| '''Gemini API key is required when using google backend. Run the app with a GEMINI_API_KEY as a Dart environment variable, for example by running with -D GEMINI_API_KEY=\$GEMINI_API_KEY or set the GEMINI_API_KEY environment variable in your shell environment.''', | ||
| ); | ||
| } | ||
| return apiKey; | ||
| } | ||
polina-c marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.