E2E Tests #163
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: E2E Tests | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # daily | |
| permissions: | |
| contents: read | |
| jobs: | |
| e2e_test: | |
| # Do not run on forked branches, | |
| # because the test does not have access to secrets in forks. | |
| if: github.repository == 'a2ui-project/a2ui' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write | |
| 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: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 | |
| - 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: false | |
| - name: Print Flutter version | |
| run: flutter --version | |
| - name: Cache pub dependencies | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 | |
| with: | |
| path: ~/.pub-cache | |
| key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} | |
| restore-keys: ${{ runner.os }}-pub- | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Run ./scripts/e2e_test.sh | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.REPO_GEMINI_API_KEY }} | |
| run: ./scripts/e2e_test.sh | |
| - name: Create Issue if E2E tests fail on main branch | |
| if: failure() && (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: ./scripts/create_issue.sh "E2E tests" "e2e_failure" |