Flutter 중급반 스터디 14기 4주차
2023-07-17 00:00:00 # flutter-study-14th

Test Coverage 100% 만들기

dynamic_image_crop | Flutter Package

Codecov

테스트 폴더

1
2
3
4
5
6
7
8
9
10
11
12
13
14
test/
├── assets/
│ ├── sample_image.png
│ └── sample_image_vertical.png
├── controller/
│ ├── crop_controller_test.dart
│ └── image_change_notifier_test.dart
├── crop_area_moving_test.dart
├── drawing_view_crop_test.dart
├── figure_shape_view_crop_test.dart
├── none_crop_type_test.dart
├── resize_crop_area_test.dart
└── test_utils.dart

CI에 적용하기

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
name: check test coverage

on:
pull_request:
branches:
- publish
- example_page

jobs:
coverage:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: subosito/flutter-action@v2.10.0
with:
flutter-version: '3.10.5'
- name: Install packages
run: flutter pub get
- name: run flutter test
run: flutter test --coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

publish workflow

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: Publish to pub.dev

on:
push:
branches:
- publish

jobs:
publish:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: subosito/flutter-action@v2.10.0
with:
flutter-version: '3.10.5'
- name: Install packages
run: flutter pub get
- name: Setup Pub Credentials
shell: bash
env:
INPUT_CREDENTIAL: ${{ secrets.CREDENTIAL_JSON }}
run: |
sh ./pub_login.sh
- name: Check Publish Warnings
run: dart pub publish --dry-run
- name: Publish Package
run: dart pub publish -f
  • dry-run은 필수는 아님

과외 요청 받음

  • 직장 동료 아들이 유니티로 게임 만드는 걸 재밌게 하고 있다는데, 좀 진지하게 공부 시키고 싶어서 요청 받음
  • 토요일에 잠깐 화상으로 만났는데 너무 어려보여서 당황 (초4)

노션 캡쳐

Untitled