Merge branch 'main' into issue-419-trusted-senders-page
This commit is contained in:
@@ -47,4 +47,4 @@ repos:
|
||||
language: system
|
||||
entry: bash -c 'cd "$(git rev-parse --show-toplevel)" && nix develop --command task check-ci-images'
|
||||
pass_filenames: false
|
||||
files: ^ci/main\.go$
|
||||
files: ^(ci/main\.go|\.fvmrc)$
|
||||
|
||||
+2
-2
@@ -461,12 +461,12 @@ func (m *Ci) CheckGenerated(ctx context.Context) (string, error) {
|
||||
Stdout(ctx)
|
||||
}
|
||||
|
||||
// Coverage runs unit tests with coverage gate.
|
||||
// Coverage runs unit and widget tests with coverage gate.
|
||||
func (m *Ci) Coverage(ctx context.Context) (string, error) {
|
||||
return m.setup(m.checkSrc()).
|
||||
WithExec([]string{"/bin/bash", "-c",
|
||||
`tmp=$(mktemp); trap 'rm -f "$tmp"' EXIT; ` +
|
||||
`flutter test test/unit --coverage --reporter expanded --no-pub >"$tmp" 2>&1 || { cat "$tmp"; exit 1; }; ` +
|
||||
`flutter test test/unit test/widget --exclude-tags golden --coverage --reporter expanded --no-pub >"$tmp" 2>&1 || { cat "$tmp"; exit 1; }; ` +
|
||||
`grep -E '^All [0-9]+ tests passed' "$tmp" || tail -1 "$tmp"`}).
|
||||
WithExec([]string{"dart", "scripts/check_coverage.dart"}).
|
||||
Stdout(ctx)
|
||||
|
||||
@@ -6,7 +6,18 @@ set -euo pipefail
|
||||
ROOT=$(git rev-parse --show-toplevel)
|
||||
FILE="$ROOT/ci/main.go"
|
||||
|
||||
images=$(grep -oP 'From\("\K[^"]+' "$FILE" | sort -u)
|
||||
# Static images from From("...") literals in ci/main.go
|
||||
static_images=$(grep -oP 'From\("\K[^"]+' "$FILE" | sort -u)
|
||||
|
||||
# Dynamic Flutter image derived from .fvmrc (not a literal in main.go)
|
||||
FVMRC="$ROOT/.fvmrc"
|
||||
flutter_version=$(python3 -c "import json; print(json.load(open('$FVMRC'))['flutter'])" 2>/dev/null || true)
|
||||
flutter_image=""
|
||||
if [ -n "$flutter_version" ]; then
|
||||
flutter_image="ghcr.io/cirruslabs/flutter:$flutter_version"
|
||||
fi
|
||||
|
||||
images=$(printf '%s\n%s\n' "$static_images" "$flutter_image" | grep -v '^$' | sort -u)
|
||||
|
||||
if [ -z "$images" ]; then
|
||||
echo "check-ci-images: no From() image references found in $FILE"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
@Tags(['golden'])
|
||||
library;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/misc.dart' show Override;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
Reference in New Issue
Block a user