Skip to content

Commit

Permalink
ci: better generate coverage script
Browse files Browse the repository at this point in the history
  • Loading branch information
SiongSng committed Jul 28, 2023
1 parent e5a4442 commit c819a4a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 34 deletions.
69 changes: 39 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,44 @@ jobs:
test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: "3.10.5"
channel: "stable"
cache: true
- name: Install Rust Language
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Test And Generate Coverage
run: |
cd app
- uses: actions/checkout@v3
- name: Install Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: "3.10.5"
channel: "stable"
cache: true
- name: Install Rust Language
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Test And Generate Coverage
run: |
mkdir -p coverage
cd app
flutter pub get
flutter test --coverage
sed "s/^SF:.*lib/SF:app\/lib/g" coverage/lcov.info >> ../coverage/lcov.info
cd ..
cd packages
for d in */ ; do
cd $d
flutter pub get
flutter test --coverage --coverage-path packages/coverage/lcov.base.info
flutter test --coverage
escapedPath="$(echo packages/$d | sed 's/\//\\\//g')"
sed "s/^SF:.*lib/SF:$escapedPath\/lib/g" coverage/lcov.info >> ../../coverage/lcov.info
rm -rf coverage
cd ..
cd packages
for d in */ ; do
cd $d
flutter pub get
flutter test --coverage --merge-coverage
cd ..
done
- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
files: packages/coverage/lcov.info
fail_ci_if_error: true
done
continue-on-error: true
- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
files: coverage/lcov.info
fail_ci_if_error: true
1 change: 1 addition & 0 deletions packages/era_connect_ui/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dev_dependencies:

# The following section is specific to Flutter packages.
flutter:
uses-material-design: true
assets:
- icons/
# To add assets to your package, add an assets section, like this:
Expand Down
8 changes: 4 additions & 4 deletions packages/era_connect_ui/test/theme/era_accent_color_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
group('Check accent colors', () {
test('green color', () {
expect(EraAccentColor.green.color, equals(const Color(0x0014ae5c)));
expect(EraAccentColor.green.color, equals(const Color(0xFF14ae5c)));
});

test('blue color', () {
expect(EraAccentColor.blue.color, equals(const Color(0x007caed3)));
expect(EraAccentColor.blue.color, equals(const Color(0xFF7caed3)));
});

test('yellow color', () {
expect(EraAccentColor.yellow.color, equals(const Color(0x00d3e950)));
expect(EraAccentColor.yellow.color, equals(const Color(0xFFd3e950)));
});

test('purple color', () {
expect(EraAccentColor.purple.color, equals(const Color(0x00d3e950)));
expect(EraAccentColor.purple.color, equals(const Color(0xFF9747FF)));
});
});
}

0 comments on commit c819a4a

Please sign in to comment.