Skip to content

Commit

Permalink
feat: add optional setup step to flutter and dart package workflows (#85
Browse files Browse the repository at this point in the history
)
  • Loading branch information
felangel authored Oct 19, 2022
1 parent 4fec4ab commit d6c97a4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 16 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ jobs:
verify-dart:
uses: ./.github/workflows/dart_package.yml
with:
working_directory: examples/dart_package
setup: dart --version
platform: "vm,chrome"
working_directory: examples/dart_package

verify-flutter:
uses: ./.github/workflows/flutter_package.yml
with:
flutter_channel: stable
flutter_version: 3.3.3
flutter_version: 3.3.4
setup: flutter doctor --verbose
working_directory: examples/flutter_package

verify-pana-dart:
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/dart_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Dart Package Workflow
on:
workflow_call:
inputs:
analyze_directories:
required: false
type: string
default: "lib test"
concurrency:
required: false
type: number
Expand All @@ -15,18 +19,14 @@ on:
required: false
type: string
default: "stable"
working_directory:
required: false
type: string
default: "."
min_coverage:
required: false
type: number
default: 100
analyze_directories:
platform:
required: false
type: string
default: "lib test"
default: "vm"
report_on:
required: false
type: string
Expand All @@ -35,10 +35,14 @@ on:
required: false
type: string
default: "ubuntu-latest"
platform:
setup:
required: false
type: string
default: "vm"
default: ""
working_directory:
required: false
type: string
default: "."

jobs:
build:
Expand All @@ -60,6 +64,10 @@ jobs:
- name: 📦 Install Dependencies
run: dart pub get

- name: ⚙️ Run Setup
if: "${{inputs.setup != ''}}"
run: ${{inputs.setup}}

- name: ✨ Check Formatting
run: dart format --set-exit-if-changed .

Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/flutter_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ on:
required: false
type: string
default: ""
working_directory:
required: false
type: string
default: "."
min_coverage:
required: false
type: number
default: 100
runs_on:
required: false
type: string
default: "ubuntu-latest"
setup:
required: false
type: string
default: ""
test_optimization:
required: false
type: boolean
Expand All @@ -35,10 +39,10 @@ on:
required: false
type: boolean
default: false
runs_on:
working_directory:
required: false
type: string
default: "ubuntu-latest"
default: "."

jobs:
build:
Expand All @@ -65,6 +69,10 @@ jobs:
very_good --analytics false
very_good packages get --recursive
- name: ⚙️ Run Setup
if: "${{inputs.setup != ''}}"
run: ${{inputs.setup}}

- name: ✨ Check Formatting
run: flutter format --set-exit-if-changed lib test

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ The Dart package workflow consists of the following steps:

**Default** `"ubuntu-latest"`

#### `setup`

**Optional** An optional command that should be executed immediately after dependencies are installed.

**Default** `""`

#### `platform`

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

**Default** 100

#### `setup`

**Optional** An optional command that should be executed immediately after dependencies are installed.

**Default** `""`

#### `working_directory`

**Optional** The path to the root of the Flutter package.
Expand Down

0 comments on commit d6c97a4

Please sign in to comment.