Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
228 commits
Select commit Hold shift + click to select a range
a92897b
feat: add automatic weight sync from Apple Health and Google Health C…
JohnWeidner Mar 27, 2026
7bab9b6
feat: add unit label to weight form and convert health sync values
JohnWeidner Mar 27, 2026
bed1416
Merge branch 'master' into feat/health-platform-weight-sync
JohnWeidner Mar 27, 2026
627b8b9
fix: unit conversion on enable, dashboard refresh, and permission check
JohnWeidner Mar 27, 2026
2f10ee9
refactor: simplify health sync code after review
JohnWeidner Mar 27, 2026
86246ac
refactor: use l10n for health sync user-facing strings
JohnWeidner Mar 27, 2026
a4d03bc
feat: import all health history instead of last 30 days
JohnWeidner Mar 27, 2026
e1968d0
fix: request historical data access from Health Connect
JohnWeidner Mar 27, 2026
7001bca
feat(measurements): implement measurement groups, dynamic formula eva…
pankaj-basnet May 16, 2026
38c0a16
adjust code files as per backend measurement entryurl endpoint
pankaj-basnet May 19, 2026
f9b9885
feat(weight): add time-range selector to body weight chart
Bhavit16 Jun 24, 2026
ec11509
refactor(models): update workout session time tracking to DateTime
pankaj-basnet Jul 1, 2026
13218a2
feat(database): upgrade session time tracking to full DateTime
pankaj-basnet Jul 1, 2026
ee084f1
Merge branch 'pr-1156' into feature/health-sync
rolandgeider Jul 2, 2026
18b745f
Start reworking the sync logic
rolandgeider Jul 2, 2026
01c13b1
Add health repository
rolandgeider Jul 2, 2026
84d0de7
feat(measurements): introduce MetricType enum and category properties
pankaj-basnet Jul 2, 2026
5d1f037
feat(measurements): add metric type selection and detail view support
pankaj-basnet Jul 3, 2026
6c3373f
feat(measurements): add metricType to category schema
pankaj-basnet Jul 4, 2026
5ff9d25
feat(charts): add smoothed trendline to measurement charts
pankaj-basnet Jul 4, 2026
bad4993
Merge branch 'feature/health-sync' into feat/healthsync
rolandgeider Jul 9, 2026
4250784
Cleanup, translations and small tests
rolandgeider Jul 9, 2026
a7a31ba
Merge pull request #1251 from pankaj-basnet/feat/healthsync
rolandgeider Jul 9, 2026
23a792f
Merge branch 'feature/health-sync' into feature/dynamic-measurements-…
rolandgeider Jul 9, 2026
8aac3da
Add workaround for swift package manager for the health package
rolandgeider Jul 10, 2026
066d643
Refactor the data model for multi-value categories
rolandgeider Jul 10, 2026
29032de
feat(measurements): add order field to MeasurementCategory model and …
pankaj-basnet Jul 10, 2026
8ae054d
Merge branch 'feature/health-sync' into feat/healthsync--sort-measure…
rolandgeider Jul 10, 2026
cbb960b
Filter out sub-categories, fix off-by-one index
rolandgeider Jul 10, 2026
3fc33e1
Add multi-value measurements to the test data
rolandgeider Jul 10, 2026
55cdd64
Fix trigger for CI
rolandgeider Jul 10, 2026
c088af2
Merge pull request #1261 from pankaj-basnet/feat/healthsync--sort-mea…
rolandgeider Jul 10, 2026
e81bb99
test(measurements): add unit tests for chart rendering, aggregation, …
pankaj-basnet Jul 12, 2026
5c129bb
test(measurements): add GroupMeasurementEntryForm widget tests and ad…
pankaj-basnet Jul 13, 2026
432d9f1
feat(measurements): add category form test , update categories screen…
pankaj-basnet Jul 13, 2026
b6c83ff
Rename files so they match the ones they test
rolandgeider Jul 17, 2026
5a65b84
Merge pull request #1266 from pankaj-basnet/feat/tests--measurements-…
rolandgeider Jul 17, 2026
f0a088e
Round imported health values to match backend and lowercase external ids
rolandgeider Jul 10, 2026
7ebb97c
Fix source default, hide health settings section when unavailable
rolandgeider Jul 10, 2026
3bea05e
Read health data with an overlap window to catch backdated records
rolandgeider Jul 10, 2026
6d08c0a
Notify the user with a snackbar when health permissions are denied
rolandgeider Jul 10, 2026
31153a2
Update translations
rolandgeider Jul 10, 2026
d8408aa
Convert HealthSyncState to freezed
rolandgeider Jul 10, 2026
6cb489a
Fix iOS health usage description
rolandgeider Jul 11, 2026
a9e2950
Add some more tests
rolandgeider Jul 11, 2026
45aeda7
Merge branch 'master' into feature/health-sync
rolandgeider Jul 28, 2026
f13ef5f
Merge branch 'master' into feat/weight-chart-range
rolandgeider Jul 28, 2026
e1a613d
Merge branch 'feat/weight-chart-range' into feature/health-sync
rolandgeider Jul 28, 2026
41623e3
Merge remote-tracking branch 'origin/master' into feature/health-sync
rolandgeider Jul 30, 2026
b86c1e7
Store body weight in the official measurements category
rolandgeider Jul 30, 2026
6d0352a
Track the entry unit in extra_data and convert on display
rolandgeider Jul 30, 2026
488338d
Keep the health sync watermark while a metric is skipped
rolandgeider Jul 30, 2026
cc22ac6
Do not offer the body weight metric type for new categories
rolandgeider Jul 30, 2026
ea8c2a8
Cleanups
rolandgeider Jul 30, 2026
1b87fd2
Show the weight form bounds rounded inwards
rolandgeider Jul 30, 2026
d1c7333
Bump app version and min required server version
rolandgeider Jul 31, 2026
01615fb
Import blood pressure readings into a measurement group
rolandgeider Jul 31, 2026
41ceee9
Import resting heart rate
rolandgeider Jul 31, 2026
3a4d557
Import sleep duration as a daily total
rolandgeider Jul 31, 2026
a44aafa
Bump health bridge commit
rolandgeider Jul 31, 2026
a27ead1
Key daily health aggregates with a UUID
rolandgeider Jul 31, 2026
fc06377
Key health entries with UUIDs the server accepts
rolandgeider Jul 31, 2026
8ff1a7b
Fix x axis labels on measurement bar charts
rolandgeider Jul 31, 2026
5178bb5
Let a measurement chart draw several named series
rolandgeider Jul 31, 2026
a8f610c
Chart the components of a measurement group together
rolandgeider Jul 31, 2026
9561f95
Show the daily range of aggregated measurements as a band
rolandgeider Jul 31, 2026
5cbd71c
Draw a group reading as one bar spanning its components
rolandgeider Jul 31, 2026
7b0f6ee
Size chart marks by density and condense dense series
rolandgeider Jul 31, 2026
abd2959
Compute the moving average in a single pass
rolandgeider Jul 31, 2026
4686a83
Load only the watched category and its components
rolandgeider Jul 31, 2026
3b8c4be
Band only the measured series, not its average
rolandgeider Jul 31, 2026
de9ca4b
Convert aggregate bounds along with their value
rolandgeider Jul 31, 2026
557eaa2
Keep the group card readable when readings are not paired
rolandgeider Jul 31, 2026
d61e833
Dedupe joined entries with a set instead of a scan
rolandgeider Jul 31, 2026
140b810
Draw nutrition plan periods as bands instead of per-plan charts
rolandgeider Jul 31, 2026
458b3d5
Show the weight development on the nutrition plan detail screen
rolandgeider Jul 31, 2026
dbd1987
Slice the 30-day trend from the full history instead of recomputing it
rolandgeider Jul 31, 2026
765a90f
Derive the shared chart series once per build
rolandgeider Jul 31, 2026
f217317
Update test data for screenshot tests
rolandgeider Jul 31, 2026
ed67ff7
Let the user pick the chart range for measurements too
rolandgeider Jul 31, 2026
4a98f61
Improve translations
rolandgeider Jul 31, 2026
d2ad8e9
Remove unused strings
rolandgeider Jul 31, 2026
7a66c21
Keep chart y-axis labels on a single line
rolandgeider Jul 31, 2026
59d8b09
Show the health sync status and allow syncing manually
rolandgeider Jul 31, 2026
4f7fde6
Tell the user when the health platform withholds its data
rolandgeider Jul 31, 2026
aab7646
Offer installing Health Connect instead of hiding the sync
rolandgeider Jul 31, 2026
db2c2c5
Derive the ids of typed measurement categories
rolandgeider Aug 1, 2026
655d3b7
Read the full history when a metric lost its category
rolandgeider Aug 1, 2026
830a03a
Declare every imported type in the Android manifest
rolandgeider Aug 1, 2026
c1c59ed
Give debug builds their own name and launcher colour
rolandgeider Aug 1, 2026
78a0d9f
Ask the health platform for permissions per type
rolandgeider Aug 1, 2026
5f158c7
Give each metric the read window its density affords
rolandgeider Aug 2, 2026
3a26357
Import the sleep stages, and merge their intervals
rolandgeider Aug 2, 2026
e1b5f13
Chart a group as a whole, and let it be opened
rolandgeider Aug 2, 2026
2d74480
Read only the entries the range charts
rolandgeider Aug 2, 2026
8480c37
Mirror the per-metric value limits from the server
rolandgeider Aug 2, 2026
d338c45
Bound the body weight query by the chart range
rolandgeider Aug 2, 2026
6cabbeb
Move the body weight provider next to the measurements
rolandgeider Aug 2, 2026
6d1b779
Dissolve WeightOverview into EntriesList
rolandgeider Aug 2, 2026
78e908d
Show typed categories under their translated name
rolandgeider Aug 2, 2026
2055480
Let the user pick the chart of a measurement category
rolandgeider Aug 2, 2026
b4ec838
Do not offer a chart type where it has no effect
rolandgeider Aug 2, 2026
86f4463
Do not offer a chart type where it has no effect
rolandgeider Aug 2, 2026
d237876
Attribute a night to its wake day by the calendar
rolandgeider Aug 3, 2026
e249812
Stop an empty metric from forcing a full read every time
rolandgeider Aug 3, 2026
53a7baa
Start the read window where the metric's day starts
rolandgeider Aug 3, 2026
878d34c
Read only the body weight category, not every category
rolandgeider Aug 3, 2026
4b356f8
Pick the metric instead of typing it into a form
rolandgeider Aug 3, 2026
d4e28bf
Cap the metric picker's height
rolandgeider Aug 3, 2026
d93794d
Point the weight screen test at the method the screen calls
rolandgeider Aug 3, 2026
ab5331b
Fix tests
rolandgeider Aug 4, 2026
e68bde2
Merge branch 'master' into feature/health-sync
rolandgeider Aug 4, 2026
47f2676
Don't link a symbol the file does not import
rolandgeider Aug 4, 2026
cecdd1c
Read durations in hours and minutes
rolandgeider Aug 4, 2026
ed3d30a
Add a weekly change (delta) chart type
rolandgeider Aug 5, 2026
4aed48d
Read duration deltas in hours and minutes
rolandgeider Aug 5, 2026
cd47975
Add distribution histogram chart type
rolandgeider Aug 5, 2026
82be49c
Add per-category chart settings (trend, average window)
rolandgeider Aug 5, 2026
1fd6b50
Replace the 30-day chart with a one-month range
rolandgeider Aug 5, 2026
449beec
Keep the measurement screens on screen while a range loads
rolandgeider Aug 5, 2026
0d08f41
Updated goldens
rolandgeider Aug 6, 2026
c029894
Keep the measurement screens on screen while a range loads
rolandgeider Aug 6, 2026
c490bdb
Aggregate measurement chart points in SQL
rolandgeider Aug 6, 2026
34f3d1d
Read a group's chart points from one aggregated query
rolandgeider Aug 6, 2026
52eab30
Read the measurement lists a page at a time
rolandgeider Aug 6, 2026
459defa
Drop a health type whole when one of its windows fails
rolandgeider Aug 6, 2026
98ff130
Split the measurement charts into four files
rolandgeider Aug 6, 2026
a0fddd6
Tidy up the measurement and health helpers
rolandgeider Aug 6, 2026
1ee3588
Read the health importer's dedup keys from the database
rolandgeider Aug 6, 2026
473ffbe
Drop entries from the measurement category model
rolandgeider Aug 6, 2026
3c2a800
Move the health import into a service of its own
rolandgeider Aug 6, 2026
13e1197
Give every health metric its own watermark
rolandgeider Aug 6, 2026
3c4cc4e
Move the chart maths out of the widgets
rolandgeider Aug 7, 2026
0329f3f
Give the measurement entry form a draft
rolandgeider Aug 7, 2026
4f22659
Give the distribution chart the height it is drawn in
rolandgeider Aug 7, 2026
3dc9789
Activate the rest of the metric types
rolandgeider Aug 7, 2026
3855dbc
Import blood oxygen from the health platforms
rolandgeider Aug 7, 2026
9cd9aaa
Import lean body mass from the health platforms
rolandgeider Aug 7, 2026
d517e1f
Drop the "count" unit from step categories
rolandgeider Aug 7, 2026
7954377
Drop the chart title where the screen already says it
rolandgeider Aug 7, 2026
d6de435
Make the measurements a tab of their own, led by the weight
rolandgeider Aug 7, 2026
62e06d6
Share the quick steppers and the date-time pair
rolandgeider Aug 7, 2026
2ec683d
Keep the chart tooltips inside the chart
rolandgeider Aug 7, 2026
251689c
Rebuild the measurements overview as a tile grid
rolandgeider Aug 8, 2026
62f929c
Rebuild the screenshot scene for the tile grid
rolandgeider Aug 8, 2026
002ff54
Share the chart range across the measurement screens
rolandgeider Aug 8, 2026
b5d092c
Persist the shared chart range
rolandgeider Aug 9, 2026
d30482a
Default the measurement charts to one month
rolandgeider Aug 9, 2026
bb7ed8f
Say how long ago a tile's value was measured
rolandgeider Aug 9, 2026
df2791a
Keep pre-2.7 measurement rows readable
rolandgeider Aug 9, 2026
7b63067
Remove old API token exchange
rolandgeider Aug 9, 2026
520504a
Merge branch 'master' into feature/health-sync
rolandgeider Aug 10, 2026
a428aa1
Updated goldens
rolandgeider Aug 10, 2026
2fbe9d5
Merge remote-tracking branch 'origin/master' into fix/midnight-workou…
rolandgeider Aug 10, 2026
8fb4b12
Rename the session times to datetimeStart and datetimeEnd
rolandgeider Aug 10, 2026
4fd83ce
Merge PR #1309 (remove old API token exchange) for 2.7 integration te…
rolandgeider Aug 13, 2026
dd2e378
Merge PR #1248 (cross-midnight session split fix) for 2.7 integration…
rolandgeider Aug 13, 2026
fdbbdfc
Merge PR #1260 (health sync) for 2.7 integration testing
rolandgeider Aug 13, 2026
495ae9f
Reject a session end before its start again
rolandgeider Aug 13, 2026
14c6fed
Cover the session lookup for logs inside a closed session
rolandgeider Aug 13, 2026
47b91b0
Show chart errors on the dashboard weight card
rolandgeider Aug 13, 2026
d29e25d
Throttle the health sync on app start
rolandgeider Aug 13, 2026
2babef2
Format the health aggregate day without DateFormat
rolandgeider Aug 13, 2026
6f11076
Bump version
rolandgeider Aug 13, 2026
284447b
Reorder setting tiles
rolandgeider Aug 13, 2026
964a4df
Clean up leftovers around the session and measurement forms
rolandgeider Aug 13, 2026
17bb00a
Read the full history only for newly readable health types
rolandgeider Aug 13, 2026
06d11b5
Catch a refused permission request on the health retry tile
rolandgeider Aug 13, 2026
dc9b836
Compare the chart bounds against the format the sync writes
rolandgeider Aug 13, 2026
3b54903
Keep global symbols when stripping the Apple release builds
rolandgeider Aug 13, 2026
abd8355
Updated goldens
rolandgeider Aug 14, 2026
2440784
Pin the duration in the gym mode screenshot scene
rolandgeider Aug 13, 2026
534d349
Read the calculated categories
rolandgeider Aug 15, 2026
67ed4d8
Report the local sync counters in bug reports
rolandgeider Aug 15, 2026
afaa58c
Report the local sync counters in bug reports
rolandgeider Aug 15, 2026
501478f
Improve handling of days with more than one session
rolandgeider Aug 19, 2026
16bc83c
Allow users setting up calculated categories
rolandgeider Aug 20, 2026
34b9b97
Allow disabling the average and the trend lines
rolandgeider Aug 20, 2026
79a8c3e
Remove the weight screenshots, that can be seen with the measurements
rolandgeider Aug 20, 2026
558a07d
Remove the alpha channel from the screenshots
rolandgeider Aug 20, 2026
29af026
Update README.md
rolandgeider Aug 20, 2026
3b6d41d
Update profiles used when regenerating the screenshots
rolandgeider Aug 20, 2026
0fca371
Re-enable all languages
rolandgeider Aug 20, 2026
f3afb8d
Install current SDK command line tools before creating the AVD
rolandgeider Aug 20, 2026
5be9ebf
Let the measurement card footer shrink
rolandgeider Aug 20, 2026
a5daf3c
Keep the screenshot scenes off the real database
rolandgeider Aug 21, 2026
e896d4d
Turn the emulator panel portrait before taking screenshots
rolandgeider Aug 21, 2026
a04a41e
Cap the screenshot jobs at 40 minutes
rolandgeider Aug 21, 2026
74d9261
Let the screenshot driver fail loudly
rolandgeider Aug 21, 2026
4f6d23b
Do not let one flaky screenshot job cancel the others
rolandgeider Aug 21, 2026
d448f9c
Generate the screenshots in blocks of languages
rolandgeider Aug 21, 2026
45aba3b
Turn off the emulator metrics report
rolandgeider Aug 21, 2026
8ecc811
Remove the weight screenshot
rolandgeider Aug 21, 2026
185e534
Merge remote-tracking branch 'origin/master' into feature/release-2.7
rolandgeider Aug 21, 2026
a7e3b5c
Link the server's terms of service from the about page
rolandgeider Aug 22, 2026
1b74684
Show the privacy policy when Health Connect asks for it
rolandgeider Aug 22, 2026
1978d91
Use correct github bot Email
rolandgeider Aug 23, 2026
0602244
Report the device timezone to the profile
rolandgeider Aug 23, 2026
1b80ad5
Write only the timezone column when reporting the zone
rolandgeider Aug 23, 2026
cb7faba
Keep a profile save away from the timezone column
rolandgeider Aug 24, 2026
a374ad3
Cut the session calendar days in the owner's timezone
rolandgeider Aug 24, 2026
93f30d7
Stop echoing the metric type on category updates
rolandgeider Aug 24, 2026
3a931f5
Keep the oldest calendar day of a chart range
rolandgeider Aug 24, 2026
ed65a0e
Discard a token refresh that outlives its session
rolandgeider Aug 24, 2026
d3b71d6
Stream the health import one read window at a time
rolandgeider Aug 25, 2026
6f23e49
Pass the 401 through when a refresh could not deliver a new token
rolandgeider Aug 25, 2026
a8c54a8
Render the dashboard weight card through CategoriesCard
rolandgeider Aug 25, 2026
a2a6019
Save the weight form through a draft and share the group component rows
rolandgeider Aug 25, 2026
455e5fd
Create measurement groups through the transactional repository helper
rolandgeider Aug 25, 2026
f6ff275
Replace the revalidation listeners instead of stacking them
rolandgeider Aug 25, 2026
b76f6a1
Split up the measurement chart layer
rolandgeider Aug 25, 2026
62cf739
Keep the min/max band when single points carry no spread
rolandgeider Aug 25, 2026
77155d6
Remove unused symbols
rolandgeider Aug 25, 2026
6096ead
Split up auth provider
rolandgeider Aug 25, 2026
4adef23
Split the health importer
rolandgeider Aug 25, 2026
2d44189
Give the category form's build() its sections
rolandgeider Aug 25, 2026
58a58cc
Cleanup
rolandgeider Aug 25, 2026
3289db7
Assert what the spark charts actually paint
rolandgeider Aug 25, 2026
14b80c2
Add notes to the weight form
rolandgeider Aug 25, 2026
70bf59a
Test the dashboard calendar
rolandgeider Aug 25, 2026
f11cd90
Test the workout session time validator
rolandgeider Aug 25, 2026
8b6b16e
Trim and consolidate the new measurement strings
rolandgeider Aug 26, 2026
db054ca
Trim and consolidate more translation strings
rolandgeider Aug 26, 2026
deddaf7
Merge branch 'master' into feature/release-2.7
rolandgeider Aug 26, 2026
f518452
Keep the database out of the routine logs widget test
rolandgeider Aug 26, 2026
24b2d91
Retry a failed screenshot block
rolandgeider Aug 26, 2026
acfaf36
updates for ios healthkit release compliance
Aug 27, 2026
301717c
fix optional flutter plugin registrar unwrap on iOS
Aug 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions .github/scripts/portrait-avd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
#
# Turns the AVD panel portrait, as the pre-emulator-launch-script of
# android-emulator-runner. The tablet panels are landscape and rely on
# hw.initialOrientation, which the emulator ignores with -no-window.

set -euo pipefail

CONFIG="$HOME/.android/avd/${AVD_NAME:-test}.avd/config.ini"

width=$(grep '^hw.lcd.width=' "$CONFIG" | cut -d= -f2)
height=$(grep '^hw.lcd.height=' "$CONFIG" | cut -d= -f2)

# config.ini is an unordered list of key=value, so dropping the old line and
# appending the new one is enough, and unlike sed -i that behaves the same
# on a runner and on a Mac
set_property() {
grep -v "^$1=" "$CONFIG" > "$CONFIG.tmp" || true
echo "$1=$2" >> "$CONFIG.tmp"
mv "$CONFIG.tmp" "$CONFIG"
}

# Short edge first, which leaves an already portrait panel as it is
set_property hw.lcd.width "$((width < height ? width : height))"
set_property hw.lcd.height "$((width < height ? height : width))"

grep -E '^hw\.lcd\.(width|height)' "$CONFIG"
55 changes: 55 additions & 0 deletions .github/scripts/take-screenshots.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env bash
#
# Drives the screenshot test in blocks of languages, a whole run's screenshots
# do not survive the hand-over to the driver. See integration_test/README.md.

set -euo pipefail

blocks=5
attempts=3
block_timeout=10m

# Homebrew installs coreutils under the g-prefixed names only
timeout=$(command -v timeout || command -v gtimeout) || {
echo "Found neither timeout nor gtimeout, install coreutils"
exit 1
}

device_type=${1:?Usage: take-screenshots.sh <device type> [flutter drive args]}
shift

# flutter drive gives up within seconds on an offline device, so wait for it
# to come back instead of burning the next attempt on it
wait_for_device() {
adb devices | tail -n +2 | grep -q . || return 0
adb reconnect offline || true
"$timeout" 120s adb wait-for-device shell \
'while [ "$(getprop sys.boot_completed)" != 1 ]; do sleep 2; done' || true
}

for block in $(seq "$blocks"); do
for attempt in $(seq "$attempts"); do
status=0
# Both the Xcode build and the driver's connect retry forever on their own.
# timeout signals the whole process group, so no dart child survives.
"$timeout" --kill-after=30s "$block_timeout" flutter drive \
--driver=test_driver/screenshot_driver.dart \
--target=integration_test/make_screenshots_test.dart \
--dart-define=DEVICE_TYPE="$device_type" \
--dart-define=LANGUAGES="$block/$blocks" \
"$@" || status=$?

if [ "$status" -eq 0 ]; then
break
fi

if [ "$attempt" -eq "$attempts" ]; then
echo "Block $block still fails after $attempts attempts, giving up"
exit 1
fi

# Usually the device went offline while handing the images over
echo "Block $block failed with $status, attempt $((attempt + 1)) of $attempts"
wait_for_device
done
done
5 changes: 4 additions & 1 deletion .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Analyze
on:
# Direct pushes are only validated on master (post-merge); everything else
# is covered by the pull_request trigger, avoiding duplicate runs for
# same-repo PR branches.
push:
branches: [ master, ]
paths:
- '**.dart'
- 'pubspec.yaml'
Expand All @@ -9,7 +13,6 @@ on:
- 'ios/Runner/Info.plist'
- 'android/app/src/main/res/xml/locales_config.xml'
pull_request:
branches: [ master, ]
paths:
- '**/*.dart'
- 'pubspec.yaml'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ jobs:

- name: Push updated config to flathub repository
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git config user.name git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b release-${{ inputs.ref }}
git add -A
git commit -m "Update to ${{ inputs.ref }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:

- name: Tag release and commit pubspec
run: |
git config user.name Github-Actions
git config user.email github-actions@github.com
git config user.name git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add pubspec.yaml flatpak/de.wger.flutter.metainfo.xml
git commit -m "Bump version to ${{ inputs.app_version }}"
git tag ${{ inputs.app_version }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Continous Integration
name: Continuous Integration
on:
# Direct pushes are only validated on master (post-merge); everything else
# is covered by the pull_request trigger, avoiding duplicate runs for
# same-repo PR branches.
push:
branches: [ master, ]
paths:
- '**.dart'
- 'pubspec.yaml'
pull_request:
branches: [ master, ]
paths:
- '**/*.dart'
- 'pubspec.yaml'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml.bak
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
- name: Push a commit with the changed files
continue-on-error: true
run: |
git config user.name Github-actions
git config user.email github-actions@github.com
git config user.name git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Automatic linting"
git push
89 changes: 71 additions & 18 deletions .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,26 @@ permissions:

jobs:
screenshots_apple:
name: 'iOS'
name: 'Apple - ${{ matrix.device.name }}'
runs-on: macos-latest
# A clean run takes about 30 minutes, the script may retry a block twice
timeout-minutes: 75
strategy:
# The jobs write into separate folders and a flaky one should not take
# the healthy ones down with it
fail-fast: false
matrix:
device:
# Apple only needs the largest device per family, the smaller ones
# are scaled down by App Store Connect
- name: "iPhone 6.9in"
simulator: iPhone 17 Pro Max
device_type: iOSPhoneBig
folder: iPhone 6.9
- name: "iPad 13in"
simulator: iPad Pro 13-inch
device_type: iOSTabletBig
folder: iPad 13
steps:
- uses: actions/checkout@v7

Expand All @@ -23,34 +41,50 @@ jobs:
- name: Boot iOS simulator
id: boot
run: |
SIMULATOR=$(xcrun simctl list devices available | awk -F '[()]' '/iPhone 17/{print $2; exit}')
# Match the UDID explicitly, some device names contain parentheses themselves
SIMULATOR=$(xcrun simctl list devices available \
| grep -m1 '${{ matrix.device.simulator }}' \
| grep -oE '[0-9A-F]{8}(-[0-9A-F]{4}){3}-[0-9A-F]{12}')
if [ -z "$SIMULATOR" ]; then
echo "No available simulator matching '${{ matrix.device.simulator }}'"
xcrun simctl list devices available
exit 1
fi
echo "SIMULATOR=$SIMULATOR" >> $GITHUB_ENV
xcrun simctl boot "$SIMULATOR" || true
open -a Simulator || true
n=0; until xcrun simctl bootstatus "$SIMULATOR" -b || [ $n -ge 60 ]; do sleep 1; n=$((n+1)); done

# The image ships no GNU coreutils, take-screenshots.sh needs gtimeout
- name: Install coreutils
run: brew install coreutils

- name: Generate screenshots
run: |
flutter drive --driver=test_driver/screenshot_driver.dart --target=integration_test/make_screenshots_test.dart --dart-define=DEVICE_TYPE=iOSPhoneBig -d "$SIMULATOR"
run: .github/scripts/take-screenshots.sh ${{ matrix.device.device_type }} -d "$SIMULATOR"

- name: Upload screenshots
uses: actions/upload-artifact@v7
with:
name: screenshots-ios
path: fastlane/metadata/ios/**/images/iPhone 6.9/*.png
name: screenshots-ios-${{ matrix.device.device_type }}
path: fastlane/metadata/ios/**/images/${{ matrix.device.folder }}/*.png

screenshots_android:
name: 'Android - ${{ matrix.device.name }}'
runs-on: ubuntu-latest
# A clean run takes about 25 minutes, the script may retry a block twice
timeout-minutes: 60
strategy:
# The jobs write into separate folders and a flaky one should not take
# the healthy ones down with it
fail-fast: false
matrix:
device:
- name: "Phone"
profile: pixel_7_pro
profile: pixel_10
device_type: androidPhone
folder: phoneScreenshots
- name: "Tablet 7in"
profile: 7in WSVGA (Tablet)
profile: small_tablet
device_type: androidTabletSmall
folder: sevenInchScreenshots
- name: "Tablet 10in"
Expand All @@ -70,7 +104,23 @@ jobs:
sudo udevadm trigger --name-match=kvm

- name: Accept Android SDK licenses
run: yes | sdkmanager --licenses || true
run: yes | "${ANDROID_HOME:?}/cmdline-tools/latest/bin/sdkmanager" --licenses || true

# The runner image ships command line tools 12.0, which does not have the
# device definitions we need.
- name: Install current SDK command line tools
run: |
SDK="${ANDROID_HOME:?}/cmdline-tools"
yes | "$SDK/latest/bin/sdkmanager" --install "cmdline-tools;22.0"
rm -rf "$SDK/latest"
mv "$SDK/22.0" "$SDK/latest"
"$SDK/latest/bin/sdkmanager" --version

# Fail here rather than after the system image download
- name: Check the device profile exists
run: |
"${ANDROID_HOME:?}/cmdline-tools/latest/bin/avdmanager" list device --compact \
| grep -qx '${{ matrix.device.profile }}'

# Free up disk space on the runner. List taken from
# https://github.com/flathub-infra/vorarbeiter/blob/main/.github/workflows/build.yml
Expand Down Expand Up @@ -109,15 +159,16 @@ jobs:
target: google_apis
arch: x86_64
profile: ${{ matrix.device.profile }}
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
emulator-options: -no-snapshot-save -no-window -no-metrics -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
flutter drive --driver=test_driver/screenshot_driver.dart --target=integration_test/make_screenshots_test.dart --dart-define=DEVICE_TYPE=${{ matrix.device.device_type }}
pre-emulator-launch-script: .github/scripts/portrait-avd.sh
# The action runs every line of this as its own sh -c, so no loops here
script: .github/scripts/take-screenshots.sh ${{ matrix.device.device_type }}

- name: Upload screenshots
uses: actions/upload-artifact@v7
with:
name: screenshots-android-${{ matrix.device.folder }}
name: screenshots-android-${{ matrix.device.device_type }}
path: fastlane/metadata/android/**/images/${{ matrix.device.folder }}/*.png

commit_screenshots:
Expand All @@ -141,17 +192,19 @@ jobs:
- name: Merge artifacts into fastlane/metadata
run: |
set -euo pipefail
rsync --archive --checksum --itemize-changes "screenshots/screenshots-android-phoneScreenshots/" fastlane/metadata/android/
rsync --archive --checksum --itemize-changes "screenshots/screenshots-android-sevenInchScreenshots/" fastlane/metadata/android/
rsync --archive --checksum --itemize-changes "screenshots/screenshots-android-tenInchScreenshots/" fastlane/metadata/android/
rsync --archive --checksum --itemize-changes "screenshots/screenshots-ios/" fastlane/metadata/ios/
for artifact in screenshots/screenshots-android-*/; do
rsync --archive --checksum --itemize-changes "$artifact" fastlane/metadata/android/
done
for artifact in screenshots/screenshots-ios-*/; do
rsync --archive --checksum --itemize-changes "$artifact" fastlane/metadata/ios/
done

- name: Commit screenshots to a dated branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add fastlane/metadata/android fastlane/metadata/ios || true
if git diff --staged --quiet; then
echo "No new or changed screenshots to commit."
Expand Down
10 changes: 9 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ android {
defaultConfig {
// Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "de.wger.flutter"
minSdkVersion flutter.minSdkVersion
minSdkVersion 26
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName

// Overridden by the debug build type. Set here rather than per build
// type so the profile variant has it as well
resValue "string", "app_name", "wger"
}

signingConfigs {
Expand All @@ -59,7 +63,11 @@ android {
signingConfig signingConfigs.release
}
debug {
// Own application id and name, so a debug build can sit next to the
// installed release one on the same device. The launcher icon keeps
// the wger logo on a different background, see src/debug/res
applicationIdSuffix ".debug"
resValue "string", "app_name", "wger - debug"
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions android/app/src/debug/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Background of the adaptive launcher icon. Overrides the release blue so
a debug build is recognisable at a glance next to the installed app -->
<color name="ic_launcher_background">#e63946</color>
</resources>
Loading
Loading