-
-
Notifications
You must be signed in to change notification settings - Fork 19
119 lines (106 loc) · 3.33 KB
/
dart_package.yaml
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#Source: https://github.com/VeryGoodOpenSource/very_good_workflows/blob/v1/.github/workflows/dart_package.yml
name: Oidc Dart Package Workflow
on:
workflow_call:
inputs:
flutter_channel:
required: false
type: string
default: "stable"
flutter_version:
required: false
type: string
default: "3.22.0"
analyze_directories:
required: false
type: string
default: "lib test"
concurrency:
required: false
type: number
default: 4
coverage_excludes:
required: false
type: string
default: ""
dart_sdk:
required: false
type: string
default: "stable"
min_coverage:
required: false
type: number
default: 100
platform:
required: false
type: string
default: "vm"
check_ignore:
required: false
type: boolean
default: false
report_on:
required: false
type: string
default: "lib"
runs_on:
required: false
type: string
default: "ubuntu-latest"
setup:
required: false
type: string
default: ""
working_directory:
required: false
type: string
default: "."
custom_tests:
required: false
type: string
default: ""
jobs:
build:
defaults:
run:
working-directory: ${{inputs.working_directory}}
runs-on: ${{inputs.runs_on}}
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{inputs.flutter_version}}
channel: ${{inputs.flutter_channel}}
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: bluefireteam/melos-action@v3
- name: ⚙️ Run Setup
if: "${{inputs.setup != ''}}"
run: ${{inputs.setup}}
- name: ✨ Check Formatting
run: dart format --set-exit-if-changed .
- name: 🕵️ Analyze
continue-on-error: true
run: dart analyze --fatal-warnings ${{inputs.analyze_directories}}
- name: 🧪 Run Tests
run: |
dart pub global activate coverage 1.2.0
dart test -j ${{inputs.concurrency}} --coverage=coverage --platform=${{inputs.platform}} && dart pub global run coverage:format_coverage --lcov ${{(inputs.check_ignore && '--check-ignore') || ''}} --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=${{inputs.report_on}}
- name: 🧪 Run Custom Tests
if: "${{inputs.custom_tests != ''}}"
run: ${{inputs.custom_tests}}
- name: Report to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ${{inputs.working_directory}}/coverage/lcov.info
fail_ci_if_error: false
# - name: 📊 Check Code Coverage
# uses: VeryGoodOpenSource/very_good_coverage@v2
# with:
# path: ${{inputs.working_directory}}/coverage/lcov.info
# exclude: ${{inputs.coverage_excludes}}
# min_coverage: ${{inputs.min_coverage}}