Skip to content

add a standalone dispose(), and make it work on every platform #245

add a standalone dispose(), and make it work on every platform

add a standalone dispose(), and make it work on every platform #245

Workflow file for this run

name: Dart CI
on:
push:
pull_request:
jobs:
test:
# Windows is not incidental: the win32 bindings are compiled on every
# `dart.library.io` platform, so a `package:win32` break shows up as a
# broken iOS build. Running the suite on both catches it either way.
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Install dependencies
run: flutter pub get
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .
- name: Analyze
run: flutter analyze --fatal-infos
- name: Run tests
run: flutter test
# The example is a separate package: neither analyze nor test reaches it
# from the repository root, which is how its widget test sat broken
# against a UI it had never matched.
- name: Analyze the example
run: cd example && flutter analyze --fatal-infos
- name: Test the example
run: cd example && flutter test
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- buildcommand: ios
buildargs: --no-codesign
os: macos-latest
# No macos build: the example's keychain-access-groups entitlement
# resolves $(AppIdentifierPrefix) from the signing team, so the Runner
# cannot be built without a development certificate.
- buildcommand: windows
os: windows-latest
- buildcommand: linux
os: ubuntu-latest
- buildcommand: appbundle
os: ubuntu-latest
- buildcommand: web
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- uses: actions/setup-java@v4
if: matrix.buildcommand == 'appbundle'
with:
java-version: '17'
distribution: 'temurin'
- name: Install linux build dependencies
if: matrix.buildcommand == 'linux'
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libsecret-1-dev \
gnome-keyring dbus-x11 xvfb
- name: Build for ${{ matrix.buildcommand }}
run: cd example && flutter build ${{ matrix.buildcommand }} ${{ matrix.buildargs }}
# The only place the Linux implementation is ever executed. Everything
# else about it — the forceInit bookkeeping, the GHashTable lifetime, the
# response sites — is verified by compiling and reading. libsecret needs a
# session bus and an unlocked keyring, and the desktop runner needs a
# display, hence dbus-run-session and xvfb.
- name: Run the integration tests against libsecret
if: matrix.buildcommand == 'linux'
run: |
# The daemon will not create a keyring for an empty password, and the
# graphical prompter it falls back to cannot open a display — so a
# first run has no collection to store into and every write fails with
# "Object does not exist at /org/freedesktop/secrets/collection/login".
# A non-empty password and an existing keyrings directory are what
# make the login keyring appear.
mkdir -p "$HOME/.local/share/keyrings"
cd example
dbus-run-session -- bash -c '
echo -n "ci" | gnome-keyring-daemon --unlock --components=secrets
xvfb-run -a flutter test integration_test -d linux'
- name: Fail if CocoaPods was pulled back in
if: matrix.buildcommand == 'ios'
run: |
if [ -e "example/ios/Podfile" ]; then
echo "A Podfile was generated: the Swift Package Manager support regressed." >&2
exit 1
fi
# A plugin that never linked produces a perfectly successful build; the
# failure surfaces on a user's device as MissingPluginException. The build
# exiting 0 says the app compiled, not that this package is inside it, so
# ask the artifact instead of the exit code.
- name: Fail if the plugin did not link
if: matrix.buildcommand == 'ios'
run: |
binary="example/build/ios/iphoneos/Runner.app/Runner"
if [ ! -f "$binary" ]; then
echo "Expected a built binary at $binary; the check cannot run." >&2
exit 1
fi
count=$(nm "$binary" | grep -c biometric_storage || true)
echo "biometric_storage symbols in the binary: $count"
if [ "$count" -eq 0 ]; then
echo "The plugin is absent from the linked binary." >&2
exit 1
fi