eval-workflow #736
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
| # 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-workflow | |
| on: | |
| push: | |
| # Workflow runs on push to any branch. | |
| schedule: | |
| - cron: "0 * * * *" # hourly | |
| jobs: | |
| eval-job: | |
| # Do not run on forked branches, | |
| # because the test does not have access to secrets in forks. | |
| if: github.repository == 'flutter/genui' | |
| runs-on: ubuntu-latest | |
| environment: eval | |
| steps: | |
| - name: Check that REPO_GEMINI_API_KEY is set and available | |
| env: | |
| # REPO_GEMINI_API_KEY is expected to be set in the repository secrets | |
| # See https://docs.github.com/en/actions/security-guides/encrypted-secrets | |
| GEMINI_API_KEY: ${{ secrets.REPO_GEMINI_API_KEY }} | |
| run: | | |
| if [ -z "$GEMINI_API_KEY" ]; then | |
| echo "ERROR: REPO_GEMINI_API_KEY is not set" | |
| exit 1 | |
| fi | |
| echo "GEMINI_API_KEY has ${#GEMINI_API_KEY} characters" | |
| - name: Install Flutter | |
| # Before bumping, verify the new version is on the flutter org's | |
| # enterprise actions allowlist, or CI will fail with startup_failure. | |
| uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e | |
| with: | |
| channel: beta | |
| cache: true | |
| - name: Print Flutter version | |
| run: flutter --version | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Install dependencies | |
| working-directory: examples/eval | |
| run: dart pub get | |
| - name: Run eval tests | |
| working-directory: examples/eval | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.REPO_GEMINI_API_KEY }} | |
| run: flutter test --dart-define=GEMINI_API_KEY=$GEMINI_API_KEY | |
| - name: Cache dependencies | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 | |
| with: | |
| path: ${{ env.PUB_CACHE }} | |
| key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} | |
| restore-keys: ${{ runner.os }}-pub- | |