Skip to content

Commit

Permalink
update github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed May 2, 2024
1 parent 76a72a8 commit 04527f1
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/credential_manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [ pull_request, push ]

jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
uses: TalaoDAO/AltMe/.github/workflows/flutter_package.yaml@v1
with:
flutter_channel: stable
flutter_version: 3.19.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cryptocurrency_keys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [ pull_request, push ]

jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
uses: TalaoDAO/AltMe/.github/workflows/flutter_package.yaml@v1
with:
flutter_channel: stable
flutter_version: 3.19.6
Expand Down
120 changes: 120 additions & 0 deletions .github/workflows/flutter_package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Flutter Package Workflow

on:
workflow_call:
inputs:
analyze_directories:
required: false
type: string
default: "lib test"
concurrency:
required: false
type: number
default: 4
coverage_excludes:
required: false
type: string
default: ""
flutter_channel:
required: false
type: string
default: "stable"
flutter_version:
required: false
type: string
default: ""
format_directories:
required: false
type: string
default: "lib test"
format_line_length:
required: false
type: string
default: "80"
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
default: true
test_recursion:
required: false
type: boolean
default: false
working_directory:
required: false
type: string
default: "."
package_get_excludes:
required: false
type: string
default: "!*"
secrets:
ssh_key:
required: false

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') }}

- name: 🤫 Set SSH Key
env:
ssh_key: ${{secrets.ssh_key}}
if: env.ssh_key != null
uses: webfactory/[email protected]
with:
ssh-private-key: ${{secrets.ssh_key}}

- name: 📦 Install Dependencies
run: |
flutter pub global activate very_good_cli
very_good packages get --recursive --ignore=${{inputs.package_get_excludes}}
- name: ⚙️ Run Setup
if: "${{inputs.setup != ''}}"
run: ${{inputs.setup}}

- name: ✨ Check Formatting
run: dart format --line-length ${{inputs.format_line_length}} --set-exit-if-changed ${{inputs.format_directories}}

- name: ⚙️ build with build_runner
run: dart run build_runner build --delete-conflicting-outputs

- name: 🕵️ Analyze
run: flutter analyze ${{inputs.analyze_directories}}

- name: 🧪 Run Tests
run: very_good test -j ${{inputs.concurrency}} ${{(inputs.test_recursion && '--recursive') || ''}} ${{(inputs.test_optimization && '--optimization') || '--no-optimization'}} --coverage --test-randomize-ordering-seed random

- name: 📊 Check Code Coverage
uses: VeryGoodOpenSource/very_good_coverage@v3
with:
path: ${{inputs.working_directory}}/coverage/lcov.info
exclude: ${{inputs.coverage_excludes}}
min_coverage: ${{inputs.min_coverage}}
2 changes: 1 addition & 1 deletion .github/workflows/jwt_decode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [ pull_request, push ]

jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
uses: TalaoDAO/AltMe/.github/workflows/flutter_package.yaml@v1
with:
flutter_channel: stable
flutter_version: 3.19.6
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on: [ pull_request, push ]

jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
uses: TalaoDAO/AltMe/.github/workflows/flutter_package.yaml@v1
with:
coverage_excludes: "**/*_observer.dart **/change.dart"
flutter_channel: stable
flutter_version: 3.19.6
min_coverage: 95
min_coverage: 30
12 changes: 0 additions & 12 deletions .github/workflows/secure_storage.yaml

This file was deleted.

0 comments on commit 04527f1

Please sign in to comment.