Skip to content

Add static analysis step #90

Add static analysis step

Add static analysis step #90

Workflow file for this run

name: Application ON Push & PR DO Code check
on: [push, pull_request]
jobs:
code-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "pubspec.yaml"
- name: Setup flutter
if: steps.check_files.outputs.files_exists == 'true'
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Check flutter sdk version
if: steps.check_files.outputs.files_exists == 'true'
run: flutter --version
- name: Get dependencies
if: steps.check_files.outputs.files_exists == 'true'
run: flutter pub get
- name: Run static code analysis
if: steps.check_files.outputs.files_exists == 'true'
uses: invertase/github-action-dart-analyzer@v1
- name: Run custom_lint
if: steps.check_files.outputs.files_exists == 'true'
run: dart run custom_lint
- name: Check formatting
if: steps.check_files.outputs.files_exists == 'true'
run: dart format . --set-exit-if-changed
- name: Run tests
if: steps.check_files.outputs.files_exists == 'true'
run: |
# run tests if `test` folder exists
if [ -d test ]
then
flutter test -r expanded
else
echo "Tests not found."
fi