[WIP] github workflow
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BRANCH=$1
|
||||
|
||||
if [ "$BRANCH" == "dev" ]
|
||||
then
|
||||
# TODO Flutter dev branch is currently broken so we're unable to test MacOS.
|
||||
echo "TODO: Skipping macOS testing due to Flutter dev branch issue. Switching branch to stable."
|
||||
BRANCH=stable
|
||||
fi
|
||||
|
||||
git clone https://github.com/flutter/flutter.git --depth 1 -b $BRANCH _flutter
|
||||
echo "::add-path::$GITHUB_WORKSPACE/_flutter/bin"
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
flutter pub global activate melos
|
||||
echo "::add-path::$HOME/.pub-cache/bin"
|
||||
echo "::add-path::$GITHUB_WORKSPACE/_flutter/.pub-cache/bin"
|
||||
echo "::add-path::$GITHUB_WORKSPACE/_flutter/bin/cache/dart-sdk/bin"
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
if [[ $(git ls-files --modified) ]]; then
|
||||
echo ""
|
||||
echo ""
|
||||
echo "These files are not formatted correctly:"
|
||||
for f in $(git ls-files --modified); do
|
||||
echo ""
|
||||
echo ""
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo "$f"
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo ""
|
||||
git --no-pager diff --unified=0 --minimal $f
|
||||
echo ""
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo ""
|
||||
echo ""
|
||||
done
|
||||
if [[ $GITHUB_WORKFLOW ]]; then
|
||||
git checkout . > /dev/null 2>&1
|
||||
fi
|
||||
echo ""
|
||||
echo "❌ Some files are incorrectly formatted, see above output."
|
||||
echo ""
|
||||
echo "To fix these locally, run: 'melos run format'."
|
||||
exit 1
|
||||
else
|
||||
echo ""
|
||||
echo "✅ All files are formatted correctly."
|
||||
fi
|
||||
Reference in New Issue
Block a user