Skip to content

Commit d6c97a4

Browse files
authored
feat: add optional setup step to flutter and dart package workflows (#85)
1 parent 4fec4ab commit d6c97a4

File tree

4 files changed

+46
-16
lines changed

4 files changed

+46
-16
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ jobs:
1010
verify-dart:
1111
uses: ./.github/workflows/dart_package.yml
1212
with:
13-
working_directory: examples/dart_package
13+
setup: dart --version
1414
platform: "vm,chrome"
15+
working_directory: examples/dart_package
1516

1617
verify-flutter:
1718
uses: ./.github/workflows/flutter_package.yml
1819
with:
1920
flutter_channel: stable
20-
flutter_version: 3.3.3
21+
flutter_version: 3.3.4
22+
setup: flutter doctor --verbose
2123
working_directory: examples/flutter_package
2224

2325
verify-pana-dart:

.github/workflows/dart_package.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Dart Package Workflow
33
on:
44
workflow_call:
55
inputs:
6+
analyze_directories:
7+
required: false
8+
type: string
9+
default: "lib test"
610
concurrency:
711
required: false
812
type: number
@@ -15,18 +19,14 @@ on:
1519
required: false
1620
type: string
1721
default: "stable"
18-
working_directory:
19-
required: false
20-
type: string
21-
default: "."
2222
min_coverage:
2323
required: false
2424
type: number
2525
default: 100
26-
analyze_directories:
26+
platform:
2727
required: false
2828
type: string
29-
default: "lib test"
29+
default: "vm"
3030
report_on:
3131
required: false
3232
type: string
@@ -35,10 +35,14 @@ on:
3535
required: false
3636
type: string
3737
default: "ubuntu-latest"
38-
platform:
38+
setup:
3939
required: false
4040
type: string
41-
default: "vm"
41+
default: ""
42+
working_directory:
43+
required: false
44+
type: string
45+
default: "."
4246

4347
jobs:
4448
build:
@@ -60,6 +64,10 @@ jobs:
6064
- name: 📦 Install Dependencies
6165
run: dart pub get
6266

67+
- name: ⚙️ Run Setup
68+
if: "${{inputs.setup != ''}}"
69+
run: ${{inputs.setup}}
70+
6371
- name: ✨ Check Formatting
6472
run: dart format --set-exit-if-changed .
6573

.github/workflows/flutter_package.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@ on:
1919
required: false
2020
type: string
2121
default: ""
22-
working_directory:
23-
required: false
24-
type: string
25-
default: "."
2622
min_coverage:
2723
required: false
2824
type: number
2925
default: 100
26+
runs_on:
27+
required: false
28+
type: string
29+
default: "ubuntu-latest"
30+
setup:
31+
required: false
32+
type: string
33+
default: ""
3034
test_optimization:
3135
required: false
3236
type: boolean
@@ -35,10 +39,10 @@ on:
3539
required: false
3640
type: boolean
3741
default: false
38-
runs_on:
42+
working_directory:
3943
required: false
4044
type: string
41-
default: "ubuntu-latest"
45+
default: "."
4246

4347
jobs:
4448
build:
@@ -65,6 +69,10 @@ jobs:
6569
very_good --analytics false
6670
very_good packages get --recursive
6771
72+
- name: ⚙️ Run Setup
73+
if: "${{inputs.setup != ''}}"
74+
run: ${{inputs.setup}}
75+
6876
- name: ✨ Check Formatting
6977
run: flutter format --set-exit-if-changed lib test
7078

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ The Dart package workflow consists of the following steps:
9797

9898
**Default** `"ubuntu-latest"`
9999

100+
#### `setup`
101+
102+
**Optional** An optional command that should be executed immediately after dependencies are installed.
103+
104+
**Default** `""`
105+
100106
#### `platform`
101107

102108
**Optional** An optional, comma-separated list of platform(s) on which to run the tests.
@@ -165,6 +171,12 @@ The Flutter package workflow consists of the following steps:
165171

166172
**Default** 100
167173

174+
#### `setup`
175+
176+
**Optional** An optional command that should be executed immediately after dependencies are installed.
177+
178+
**Default** `""`
179+
168180
#### `working_directory`
169181

170182
**Optional** The path to the root of the Flutter package.

0 commit comments

Comments
 (0)