Skip to content

Commit

Permalink
Merge pull request #2 from Pavel-Sulimau/feature/add-unit-tests
Browse files Browse the repository at this point in the history
Add unit tests and update CI pipelines
  • Loading branch information
Pavel-Sulimau authored Apr 19, 2024
2 parents 17cd423 + e0c5e2f commit a65af8b
Show file tree
Hide file tree
Showing 13 changed files with 494 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
- name: Check formatting of Dart files
run: melos run format_check

- name: Run unit tests
run: melos run test_unit

- name: Run golden tests
run: melos run test_golden

Expand Down Expand Up @@ -74,6 +77,9 @@ jobs:
- name: Check formatting of Dart files with Git Diff using MELOS_PACKAGES
run: melos run format_check

- name: Run unit tests with Git Diff using MELOS_PACKAGES
run: melos run test_unit

- name: Run golden tests with Git Diff using MELOS_PACKAGES
run: melos run test_golden

Expand Down Expand Up @@ -104,5 +110,8 @@ jobs:
- name: Check formatting of Dart files with Git Diff
run: melos run format_check_diff

- name: Run unit tests with Git Diff
run: melos run test_unit_diff

- name: Run golden tests with Git Diff
run: melos run test_golden_diff
8 changes: 8 additions & 0 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ packages:
relative: true
source: path
version: "1.0.0"
equatable:
dependency: transitive
description:
name: equatable
sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
url: "https://pub.dev"
source: hosted
version: "2.0.5"
ffi:
dependency: transitive
description:
Expand Down
19 changes: 19 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ command:
flutter_lints: ^3.0.0
lints: ^3.0.0

# This _diff scripts belows will not work as intended until the following
# feature is implemented https://github.com/invertase/melos/pull/702.
scripts:
analyze: melos exec dart analyze .

Expand All @@ -40,6 +42,23 @@ scripts:

format_check: melos exec dart format . --set-exit-if-changed

test_unit_package:
run: melos exec flutter test --exclude-tags golden
packageFilters:
dirExists:
- test

test_unit_package_diff:
run: melos exec --diff=origin/main...HEAD --include-dependents \
flutter test --exclude-tags golden
packageFilters:
dirExists:
- test

test_unit: melos run test_unit_package --no-select

test_unit_diff: melos run test_unit_package_diff --no-select

test_golden_package:
run: melos exec flutter test --tags golden --dart-define=CI=true
packageFilters:
Expand Down
Loading

0 comments on commit a65af8b

Please sign in to comment.