Skip to content

Commit

Permalink
Merge pull request #33 from n-bernat/task/add-ci-tests
Browse files Browse the repository at this point in the history
Add code checks with GitHub Actions (resolves #30)
  • Loading branch information
solid-yuriiprykhodko authored Aug 10, 2023
2 parents e05ffd9 + a3c10ca commit 5dd1eaa
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/flutter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Application ON Push & PR DO Code check
on: [push, pull_request]

jobs:
code-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Check Flutter SDK version
run: flutter --version

- name: Get dependencies
run: flutter pub get

- name: Check formatting
run: dart format . --set-exit-if-changed

# example app shows warnings as an example of a working linter, so
# we can't analyze it as its purpose is to have issues
- name: Disable analyzer for example app
run: rm example/analysis_options.yaml

- name: Run default analyzer
run: flutter analyze

- name: Run custom analyzer
run: dart run custom_lint

- name: Run tests
run: |
# run tests if `test` folder exists
if [ -d test ]
then
flutter test -r expanded
else
echo "Tests not found."
fi

0 comments on commit 5dd1eaa

Please sign in to comment.