Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 33 additions & 38 deletions .github/workflows/check-settings-view-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ jobs:
lfs: true
fetch-depth: 0

- name: Install runner system packages
run: |
set -eux
# Ensure tools required by the tests and LFS are present on the runner
sudo apt-get update
sudo apt-get install -y --no-install-recommends git-lfs poppler-utils xz-utils curl ca-certificates
# Initialize git-lfs so later git lfs commands work reliably
git lfs install --system || true
shell: bash

- name: Ensure LFS assets are present (diagnostic)
run: |
# Sometimes LFS pointers are fetched but not checked out into working tree;
Expand Down Expand Up @@ -58,46 +68,31 @@ jobs:
echo "Font present; no pubspec change needed"
fi

- name: Install Flutter SDK (manual)
run: |
set -eux
# Download and extract a pinned Flutter SDK to avoid action resolution issues
FLUTTER_VERSION=3.9.2
FLUTTER_ARCHIVE=flutter_linux_${FLUTTER_VERSION}-stable.tar.xz
FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/${FLUTTER_ARCHIVE}"
echo "Downloading Flutter from $FLUTTER_URL"
# -f: fail on HTTP errors, -S: show errors, -L: follow redirects
set +e
curl -fSL -o /tmp/${FLUTTER_ARCHIVE} "$FLUTTER_URL"
CURL_EXIT=$?
set -e
if [ $CURL_EXIT -eq 0 ]; then
echo "Downloaded archive:" && ls -lh /tmp/${FLUTTER_ARCHIVE} || true
echo "File type:" && file /tmp/${FLUTTER_ARCHIVE} || true
# Verify we actually downloaded an xz-compressed archive and not an HTML error page
if file /tmp/${FLUTTER_ARCHIVE} | grep -qi 'XZ compressed'; then
echo "Extracting downloaded Flutter archive"
tar -xJf /tmp/${FLUTTER_ARCHIVE} -C $HOME
else
echo "Downloaded file is not an xz archive; will fall back to git-clone method" >&2
fi
else
echo "curl failed with exit code $CURL_EXIT; will fall back to git-clone method" >&2
fi
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

# If extraction did not produce $HOME/flutter, fall back to a shallow git clone of the tagged release
if [ ! -d "$HOME/flutter/bin" ]; then
echo "Falling back to git clone of flutter repo (tag: $FLUTTER_VERSION)"
# Clone the stable branch as a fallback (tag/archived release may not be present)
git clone --depth 1 --branch stable https://github.com/flutter/flutter.git $HOME/flutter
fi
- name: Setup Flutter (action)
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true

# Persist flutter/bin to following steps by writing to $GITHUB_PATH
echo "$HOME/flutter/bin" >> $GITHUB_PATH
echo "Flutter installed at $HOME/flutter"
# Use the explicit path in this step (GITHUB_PATH only affects later steps)
$HOME/flutter/bin/flutter --version
shell: bash
- name: Verify Flutter
run: flutter --version

- name: Cache Pub packages
uses: actions/cache@v4
with:
path: |
~/.pub-cache
~/.pub-cache/hosted
~/.pub-cache/git
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-

- name: Install dependencies
run: flutter pub get
Expand Down
41 changes: 39 additions & 2 deletions .github/workflows/coverage-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,57 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Ensure Git LFS assets
run: |
if command -v git-lfs >/dev/null 2>&1; then
git lfs install --system || true
git lfs pull --include="assets/fonts/*" || true
fi
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Cache Pub packages
uses: actions/cache@v4
with:
path: |
~/.pub-cache
~/.pub-cache/hosted
~/.pub-cache/git
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Install chrome
run: |
sudo apt update
sudo apt install -y google-chrome-stable
- name: Install pdftotext (poppler-utils)
- name: Install pdftotext (poppler-utils) and git-lfs
run: |
sudo apt-get update
sudo apt-get install -y poppler-utils git-lfs
git lfs install --system || true
- name: Install lcov (for genhtml)
run: |
sudo apt-get update
sudo apt-get install -y poppler-utils
sudo apt-get install -y lcov
- name: Verify installed tools
run: |
echo "Flutter:" && flutter --version || true
echo "pdftotext (poppler):" && pdftotext -v || echo "pdftotext not present"
echo "git-lfs:" && git lfs --version || echo "git-lfs not present"
- name: Get packages
run: flutter pub get
- name: Ensure lcov present (defensive)
run: |
if ! command -v lcov >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y lcov
else
echo "lcov present: $(lcov --version)"
fi

- name: Run coverage script
run: |
chmod +x ./scripts/collect_coverage.sh
Expand Down
64 changes: 61 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [ main, fix/web-export-import ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
coverage:
Expand All @@ -13,6 +14,8 @@ jobs:
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
with:
lfs: true

- name: Setup JDK 21
uses: actions/setup-java@v4
Expand All @@ -34,6 +37,45 @@ jobs:
- name: Verify Flutter
run: flutter --version

- name: Write CI diagnostics
if: ${{ always() }}
run: |
set -eux
out=ci-diagnostics.txt
echo "=== CI Diagnostics: $(date -u) ===" > "$out"
echo "Java:" >> "$out"; java -version 2>&1 | sed -n '1,5p' >> "$out" || true
echo "Javac:" >> "$out"; javac -version 2>&1 | sed -n '1,5p' >> "$out" || true
echo "Flutter:" >> "$out"; flutter --version 2>&1 | sed -n '1,5p' >> "$out" || true
echo "Which flutter: $(which flutter || true)" >> "$out"
echo "pdftotext:" >> "$out"; pdftotext -v 2>&1 | sed -n '1,5p' >> "$out" || echo "pdftotext not installed" >> "$out"
echo "git-lfs:" >> "$out"; git lfs --version 2>&1 | sed -n '1,5p' >> "$out" || echo "git-lfs not installed" >> "$out"
echo "lcov:" >> "$out"; lcov --version 2>&1 | sed -n '1,5p' >> "$out" || echo "lcov not installed" >> "$out"
echo "genhtml:" >> "$out"; genhtml --version 2>&1 | sed -n '1,5p' >> "$out" || echo "genhtml not installed" >> "$out"
echo "which chrome: $(which google-chrome || which google-chrome-stable || true)" >> "$out"

- name: Upload CI diagnostics
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ci-diagnostics
path: ci-diagnostics.txt

- name: Debug: print environment and tools
run: |
set -eux
echo "===== ENV ====="
uname -a || true
echo "JAVA_HOME=$JAVA_HOME"
java -version || true
javac -version || true
echo "Flutter:" && flutter --version || true
echo "Which flutter: $(which flutter || true)"
echo "pdftotext:" && pdftotext -v || echo "pdftotext not installed"
echo "git-lfs:" && git lfs --version || echo "git-lfs not installed"
echo "lcov:" && lcov --version || echo "lcov not installed"
echo "genhtml:" && genhtml --version || echo "genhtml not installed"
echo "which chrome: $(which google-chrome || which google-chrome-stable || true)"

- name: Install dependencies
run: flutter pub get

Expand All @@ -46,17 +88,33 @@ jobs:
sudo apt-get update
sudo apt-get install -y google-chrome-stable

- name: Install pdftotext (poppler-utils)
- name: Install pdftotext (poppler-utils) and git-lfs
run: |
sudo apt-get update
sudo apt-get install -y poppler-utils
sudo apt-get install -y poppler-utils git-lfs
# initialize git-lfs so git lfs pull works reliably
git lfs install --system || true

- name: Install lcov (for genhtml)
run: sudo apt-get install -y lcov
run: |
sudo apt-get update
sudo apt-get install -y lcov

- name: Run coverage script (VM + Chrome)
env:
CHROME_BIN: /usr/bin/google-chrome-stable
run: |
chmod +x ./scripts/collect_coverage.sh
# Defensive: ensure lcov is present before running the collection script
if ! command -v lcov >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y lcov
fi
# Ensure fonts/assets fetched from Git LFS (if any)
if command -v git-lfs >/dev/null 2>&1; then
git lfs pull --include="assets/fonts/*" || true
fi
echo "lcov: $(which lcov || true)" && lcov --version || true
./scripts/collect_coverage.sh

- name: Upload coverage HTML
Expand Down
57 changes: 54 additions & 3 deletions .github/workflows/flutter-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
Expand All @@ -28,6 +31,40 @@ jobs:
channel: 'stable'
- name: Verify Flutter
run: flutter --version

- name: Write CI diagnostics
if: ${{ always() }}
run: |
set -eux
out=ci-diagnostics.txt
echo "=== CI Diagnostics: $(date -u) ===" > "$out"
echo "Java:" >> "$out"; java -version 2>&1 | sed -n '1,5p' >> "$out" || true
echo "Javac:" >> "$out"; javac -version 2>&1 | sed -n '1,5p' >> "$out" || true
echo "Flutter:" >> "$out"; flutter --version 2>&1 | sed -n '1,5p' >> "$out" || true
echo "Which flutter: $(which flutter || true)" >> "$out"
echo "pdftotext:" >> "$out"; pdftotext -v 2>&1 | sed -n '1,5p' >> "$out" || echo "pdftotext not installed" >> "$out"
echo "git-lfs:" >> "$out"; git lfs --version 2>&1 | sed -n '1,5p' >> "$out" || echo "git-lfs not installed" >> "$out"
echo "lcov:" >> "$out"; lcov --version 2>&1 | sed -n '1,5p' >> "$out" || echo "lcov not installed" >> "$out"

- name: Upload CI diagnostics
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ci-diagnostics
path: ci-diagnostics.txt
- name: Debug: print environment and tools
run: |
set -eux
echo "===== ENV ====="
uname -a || true
echo "JAVA_HOME=$JAVA_HOME"
java -version || true
javac -version || true
echo "Flutter:" && flutter --version || true
echo "Which flutter: $(which flutter || true)"
echo "pdftotext:" && pdftotext -v || echo "pdftotext not installed"
echo "git-lfs:" && git lfs --version || echo "git-lfs not installed"
echo "lcov:" && lcov --version || echo "lcov not installed"
- name: Cache Flutter Pub packages
uses: actions/cache@v4
with:
Expand All @@ -38,15 +75,29 @@ jobs:
${{ runner.os }}-pub-
- name: Install dependencies
run: flutter pub get
- name: Install pdftotext (poppler-utils)
- name: Install pdftotext (poppler-utils) and git-lfs
run: |
sudo apt-get update
sudo apt-get install -y poppler-utils
sudo apt-get install -y poppler-utils git-lfs
git lfs install --system || true
- name: Verify installed tools
run: |
echo "Flutter:" && flutter --version || true
echo "pdftotext (poppler):" && pdftotext -v || echo "pdftotext not present"
echo "git-lfs:" && git lfs --version || echo "git-lfs not present"
- name: Run tests with coverage
run: flutter test --coverage --no-shard

- name: Install lcov (for genhtml)
run: sudo apt-get update && sudo apt-get install -y lcov
run: |
sudo apt-get update
sudo apt-get install -y lcov

- name: Ensure LFS assets present
run: |
if command -v git-lfs >/dev/null 2>&1; then
git lfs pull --include="assets/fonts/*" || true
fi

- name: Filter LCOV (remove non-web IO-only entries)
run: |
Expand Down
Loading