Update flutter.yml
This commit is contained in:
17
.github/workflows/flutter.yml
vendored
17
.github/workflows/flutter.yml
vendored
@@ -10,6 +10,9 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
continue-on-error: true
|
||||||
|
outputs:
|
||||||
|
needs_formatting: ${{ steps.check_format.outputs.needs_formatting }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -21,14 +24,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Formatting
|
- name: Check Formatting
|
||||||
run: |
|
run: |
|
||||||
if ! dart format --set-exit-if-changed .
|
if ! dart format --set-exit-if-changed .; then
|
||||||
flutter analyze
|
echo "needs_formatting=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "::warning::Formatting issues detected"
|
||||||
|
else
|
||||||
|
echo "needs_formatting=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
flutter analyze || echo "::warning::Lint issues found"
|
||||||
|
|
||||||
format:
|
format:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
needs: lint
|
needs: lint
|
||||||
# Only when lint fails, and its a push to develop branch
|
if: ${{ needs.lint.outputs.needs_formatting == 'true' && github.event_name == 'push' }}
|
||||||
if: ${{ failure() && needs.lint.result == 'failure' }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user