Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/base-beta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Base (beta)

on:
schedule:
- cron: '0 0 */15 * *' # Runs every 15 days for verifying changes on Flutter beta channel
push:
branches: [beta]
tags:
- '[0-9]+.[0-9]+.[0-9]+-*'

pull_request:
branches: [beta]

workflow_dispatch:

# This ensures that previous jobs for the PR are canceled when PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
uses: flutter-form-builder-ecosystem/.github/.github/workflows/minimal-quality.yaml@main
with:
codecov-name: form_builder_validators
fvm-flavor: beta
enable-generate-l10n: true
example:
uses: flutter-form-builder-ecosystem/.github/.github/workflows/build-examples.yaml@main
with:
fvm-flavor: beta
enable-generate-l10n: true


deployment:
permissions:
id-token: write
uses: flutter-form-builder-ecosystem/.github/.github/workflows/deployment.yaml@main
with:
enable-generate-l10n: true
if: ${{ github.ref_type == 'tag' }}
needs: [build, example]
109 changes: 18 additions & 91 deletions .github/workflows/base.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: CI & CD
name: Base

on:
workflow_dispatch:

push:
branches: [main]
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
- '[0-9]+.[0-9]+.[0-9]+'

pull_request:
branches: [main]

workflow_dispatch:

# This ensures that previous jobs for the PR are canceled when PR is updated
concurrency:
Expand All @@ -17,95 +18,21 @@ concurrency:

jobs:
build:
name: Build package & run tests
runs-on: ubuntu-latest
strategy:
matrix:
flutter-version: [stable, beta]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1 # Use shallow clone for faster checkout
- name: Check broken links
uses: JustinBeckwith/linkinator-action@v1
with:
paths: "**/*.md"
- name: Setup Flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
with:
path: '.fvmrc'
flavor: ${{ matrix.flutter-version }}
- name: Install dependencies
run: dart pub get
- name: Run l10n
run: flutter gen-l10n
- name: Run l10n on example
run: flutter gen-l10n
working-directory: example
- name: Format code
run: dart format --set-exit-if-changed $(find . -name "*.dart" ! \( -wholename "./lib/localization/intl/*" -or -wholename "./example/lib/localization/intl/*" \))
- name: Analyze static code
run: dart analyze
- name: Run tests
run: flutter test --no-pub --coverage
- name: Check publish warnings
run: dart pub publish --dry-run
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage/lcov.info
flags: unittests
name: form_builder_validators

uses: flutter-form-builder-ecosystem/.github/.github/workflows/minimal-quality.yaml@main
with:
codecov-name: form_builder_validators
enable-generate-l10n: true
example:
name: Build example app
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1 # Use shallow clone for faster checkout
- name: Setup Flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
with:
path: '.fvmrc'
flavor: 'stable'
- name: Install dependencies
run: dart pub get
- name: Run l10n
run: flutter gen-l10n
- name: Run l10n on example
run: flutter gen-l10n
working-directory: example
- name: Build example
run: flutter build appbundle --debug
working-directory: example
uses: flutter-form-builder-ecosystem/.github/.github/workflows/build-examples.yaml@main
with:
enable-generate-l10n: true


deployment:
# Don't use because need generate l10n before publish
# uses: flutter-form-builder-ecosystem/.github/.github/workflows/deployment.yaml@main
if: ${{ github.ref_type == 'tag' }}
needs: [build, example]
name: Deploy package
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1 # Use shallow clone for faster checkout
- uses: dart-lang/setup-dart@v1
- name: Setup Flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
with:
path: '.fvmrc'
flavor: 'stable'
- name: Install dependencies
run: dart pub get
- name: Run l10n
run: flutter gen-l10n
- name: Publish package
run: dart pub publish -v -f
uses: flutter-form-builder-ecosystem/.github/.github/workflows/deployment.yaml@main
with:
enable-generate-l10n: true
if: ${{ github.ref_type == 'tag' }}
needs: [build, example]
Loading