Skip to content

Commit 07e989f

Browse files
committed
feat: create dart_package and flutter_package workflows
0 parents  commit 07e989f

3 files changed

Lines changed: 125 additions & 0 deletions

File tree

.github/workflows/dart_package.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Dart Package Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
working_directory:
7+
required: false
8+
type: string
9+
default: "."
10+
coverage_excludes:
11+
required: false
12+
type: string
13+
default: ""
14+
15+
jobs:
16+
build:
17+
defaults:
18+
run:
19+
working-directory: ${{inputs.working_directory}}
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- uses: dart-lang/setup-dart@v1
27+
28+
- name: Install Dependencies
29+
run: dart pub get
30+
31+
- name: Format
32+
run: dart format --set-exit-if-changed .
33+
34+
- name: Analyze
35+
run: dart analyze --fatal-infos --fatal-warnings lib
36+
37+
- name: Run Tests
38+
run: |
39+
pub global activate test_coverage
40+
export PATH=$PATH:$HOME/.pub-cache/bin
41+
test_coverage
42+
43+
- name: Check Code Coverage
44+
uses: VeryGoodOpenSource/very_good_coverage@v1.2.0
45+
with:
46+
path: ${{inputs.working_directory}}/coverage/lcov.info
47+
exclude: ${{inputs.coverage_excludes}}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Flutter Package Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
working_directory:
7+
required: false
8+
type: string
9+
default: "."
10+
coverage_excludes:
11+
required: false
12+
type: string
13+
default: ""
14+
15+
jobs:
16+
build:
17+
defaults:
18+
run:
19+
working-directory: ${{inputs.working_directory}}
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- uses: subosito/flutter-action@v2
27+
with:
28+
flutter-version: 2.8.1
29+
channel: stable
30+
cache: true
31+
32+
- name: Install Dependencies
33+
run: |
34+
flutter pub global activate very_good_cli
35+
very_good --analytics false
36+
very_good packages get --recursive
37+
38+
- name: Format
39+
run: flutter format --set-exit-if-changed lib test
40+
41+
- name: Analyze
42+
run: flutter analyze lib test
43+
44+
- name: Run tests
45+
run: flutter test --no-pub --coverage --test-randomize-ordering-seed random
46+
47+
- name: Check Code Coverage
48+
uses: VeryGoodOpenSource/very_good_coverage@v1.2.0
49+
with:
50+
path: ${{inputs.working_directory}}/coverage/lcov.info
51+
exclude: ${{inputs.coverage_excludes}}

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Very Good Workflows
2+
3+
[![Very Good Ventures][logo_white]][very_good_ventures_link_dark]
4+
[![Very Good Ventures][logo_black]][very_good_ventures_link_light]
5+
6+
Developed with 💙 by [Very Good Ventures][very_good_ventures_link] 🦄
7+
8+
---
9+
10+
Reusable [GitHub Workflows][github_workflows_link] used at [Very Good Ventures][very_good_ventures_link] 🦄
11+
12+
## Usage
13+
14+
```yaml
15+
# A reusable workflow for Dart packages
16+
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@main
17+
18+
# A reusable workflow for Flutter packages
19+
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@main
20+
```
21+
22+
[github_workflows_link]: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
23+
[logo_black]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only
24+
[logo_white]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only
25+
[very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only
26+
[very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only
27+
[very_good_ventures_link]: https://verygood.ventures

0 commit comments

Comments
 (0)