-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update scripts * Update script * update ci * bootstrap * Updated bootstrap * Fix
- Loading branch information
1 parent
f4384e0
commit f77e604
Showing
9 changed files
with
82 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,30 +27,9 @@ jobs: | |
run: | | ||
flutter pub global activate very_good_cli | ||
flutter pub global activate coverage | ||
flutter pub get | ||
- name: 🦄 Generate Code | ||
run: | | ||
# Run builds with error checking in parallel | ||
dart run build_runner build -d & | ||
main_pid=$! | ||
if [ -d "packages/app_database" ]; then | ||
(cd packages/app_database && dart run build_runner build -d) & | ||
db_pid=$! | ||
fi | ||
if [ -d "packages/rest_client" ]; then | ||
(cd packages/rest_client && dart run build_runner build -d) & | ||
rest_pid=$! | ||
fi | ||
# Wait for all processes and check their exit status | ||
for pid in $main_pid $db_pid $rest_pid; do | ||
if [ -n "$pid" ]; then | ||
wait $pid || exit 1 | ||
fi | ||
done | ||
- name: 🦄 Bootstrap | ||
run: bash ./scripts/bootstrap.bash | ||
|
||
- name: Install DCM | ||
uses: CQLabs/[email protected] | ||
|
@@ -73,21 +52,8 @@ jobs: | |
# RUN TESTS + COVERAGE | ||
# ——————————————————————————————————————————————————————— | ||
|
||
- name: 🧪 Test Main App | ||
run: very_good test --coverage --exclude-coverage "*.*.dart" -j 10 | ||
working-directory: . | ||
|
||
- name: 🧪 Test App Database | ||
run: very_good test --coverage --exclude-coverage "*.*.dart" -j 10 | ||
working-directory: packages/app_database | ||
|
||
- name: 🧪 Test Rest Client | ||
run: very_good test --coverage --exclude-coverage "*.*.dart" -j 10 | ||
working-directory: packages/rest_client | ||
|
||
- name: 🔗 Merge Coverage Reports | ||
run: | | ||
bash ./scripts/merge_coverage.bash | ||
- name: 🧪 Run Tests | ||
run: bash ./scripts/test.bash | ||
|
||
- name: 📥 Upload test report | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -96,14 +62,6 @@ jobs: | |
name: test-results | ||
path: reports/tests.json | ||
|
||
- name: 📈 Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage/lcov.info | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
|
||
# ——————————————————————————————————————————————————————— | ||
# TEST REPORT JOB | ||
# ——————————————————————————————————————————————————————— | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ jobs: | |
name: Test Report | ||
path: "**/tests.json" | ||
reporter: flutter-json | ||
fail-on-error: fals | ||
fail-on-error: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,4 +57,6 @@ pubspec.lock | |
.fvm/ | ||
|
||
# Test reports | ||
reports/ | ||
reports/ | ||
coverage/ | ||
**/coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
#!/bin/bash | ||
# Get workspace dependencies | ||
flutter pub get | ||
|
||
# For each package in packages that has build_runner dependency run build_runner | ||
for dir in packages/*; do | ||
# For each package that has a pubspec.yaml file and build_runner dependency | ||
# run generation | ||
find . -type f -name "pubspec.yaml" -exec grep -q build_runner {} \; -exec dirname {} \; | while read -r dir; do | ||
if [ -f "$dir/pubspec.yaml" ]; then | ||
if grep -q build_runner "$dir/pubspec.yaml"; then | ||
pushd $dir | ||
dart run build_runner build --delete-conflicting-outputs | ||
popd | ||
fi | ||
pushd $dir | ||
printf "\nGenerating files for $dir\n" | ||
dart run build_runner build --delete-conflicting-outputs | ||
popd | ||
fi | ||
done |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Enable error handling | ||
set -e | ||
|
||
# Find directories with a pubspec.yaml and a test/ folder | ||
find_test_dirs() { | ||
find . -type f -name "pubspec.yaml" -exec dirname {} \; | while read -r dir; do | ||
if [ -d "$dir/test" ]; then | ||
echo "$dir" | ||
fi | ||
done | ||
} | ||
|
||
# Capture the output of find_test_dirs and pass it to flutter test | ||
test_dirs=$(find_test_dirs) | ||
if [ -n "$test_dirs" ]; then | ||
flutter test $test_dirs --no-pub --coverage | ||
else | ||
echo "No directories with pubspec.yaml and test/ folder found." | ||
fi |