forked from a2ui-project/a2ui
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (60 loc) · 2.3 KB
/
e2e_test.yaml
File metadata and controls
64 lines (60 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 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 == 'google/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
- name: Install uv
uses: astral-sh/setup-uv@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"