Skip to content

Commit

Permalink
check: Add suite android
Browse files Browse the repository at this point in the history
And give it the necessary prerequisites in CI.  By default the
build worker supplies JDK 11, apparently, and that's too old.
  • Loading branch information
gnprice committed Jul 10, 2024
1 parent 4929d06 commit 37421d7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ jobs:
steps:
- uses: actions/[email protected]

- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: temurin

- name: Clone Flutter SDK
# We can't do a depth-1 clone, because we need the most recent tag
# so that Flutter knows its version and sees the constraint in our
Expand Down
22 changes: 20 additions & 2 deletions tools/check
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ this_dir=${BASH_SOURCE[0]%/*}

## CLI PARSING

default_suites=(analyze test build_runner drift pigeon icons)
default_suites=(
analyze test
build_runner drift pigeon icons
android # This takes multiple minutes in CI, so do it last.
)

extra_suites=(
shellcheck # Requires its own dependency, from outside the pub system.
)
Expand Down Expand Up @@ -77,7 +82,7 @@ while (( $# )); do
--all) opt_files=all; opt_all=1; shift;;
--fix) opt_fix=1; shift;;
--verbose) opt_verbose=1; shift;;
analyze|test|build_runner|drift|pigeon|icons|shellcheck)
analyze|test|build_runner|drift|pigeon|icons|android|shellcheck)
opt_suites+=("$1"); shift;;
*) usage;;
esac
Expand Down Expand Up @@ -351,6 +356,18 @@ run_icons() {
check_no_changes "icon updates" "${outputs[@]}"
}

run_android() {
# Omitted from this check:
# pubspec.{yaml,lock} tools/check
files_check android/ \
|| return 0

flutter build apk \
|| return

flutter build appbundle
}

run_shellcheck() {
# Omitted from this check: nothing (nothing known, anyway).
files_check tools/ '!*.'{dart,js,json} \
Expand Down Expand Up @@ -424,6 +441,7 @@ for suite in "${opt_suites[@]}"; do
drift) run_drift ;;
pigeon) run_pigeon ;;
icons) run_icons ;;
android) run_android ;;
shellcheck) run_shellcheck ;;
*) echo >&2 "Internal error: unknown suite $suite" ;;
esac || failed+=( "$suite" )
Expand Down

0 comments on commit 37421d7

Please sign in to comment.