diff --git a/.github/workflows/neon.yml b/.github/workflows/neon.yml index cd5afb3d..e4f213eb 100644 --- a/.github/workflows/neon.yml +++ b/.github/workflows/neon.yml @@ -19,3 +19,13 @@ jobs: - name: Find untested Neon APIs run: ./tool/find-untested-neon-apis.sh + + dart-io-usage: + name: dart:io usage + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + + - name: Find dart:io usage + run: ./tool/find-dart-io-usage.sh diff --git a/tool/find-dart-io-usage.sh b/tool/find-dart-io-usage.sh new file mode 100755 index 00000000..009d5cca --- /dev/null +++ b/tool/find-dart-io-usage.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -euxo pipefail +cd "$(dirname "$0")/.." + +dart_io_usage=("$(grep -r packages --include "*\.dart" -e "dart:io" -l | grep -v "/\.dart_tool/" | grep -v "/bin/" | grep -v "/test_driver/" || true)") + +if [[ -n "${dart_io_usage[*]}" ]]; then + printf "%s\n" "${dart_io_usage[@]}" + exit 1 +fi