Align between #380
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Base | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+*' | |
pull_request: | |
branches: [main] | |
# 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: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check broken links | |
uses: JustinBeckwith/linkinator-action@v1 | |
with: | |
paths: "**/*.md" | |
- name: Get Flutter version by FVM | |
uses: kuhnroyal/flutter-fvm-config-action@v2 | |
id: fvm-config-action | |
with: | |
path: '.fvmrc' | |
flavor: 'stable' | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | |
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} | |
cache: true | |
- name: Install dependencies | |
run: dart pub get | |
- name: Run l10n | |
run: flutter gen-l10n | |
- name: Run l10n on example | |
run: | | |
cd example | |
flutter gen-l10n | |
- 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 --coverage | |
- name: Check publish warnings | |
run: dart pub publish --dry-run | |
- name: Build example | |
run: | | |
cd example | |
flutter build appbundle --debug | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: coverage/lcov.info | |
flags: unittests | |
name: form_builder_validators | |
deployment: | |
if: ${{ github.ref_type == 'tag' }} | |
needs: build | |
name: Deploy package | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dart-lang/setup-dart@v1 | |
- name: Flutter action | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
# use the build-in cache from Subosito | |
cache: true | |
- name: Install dependencies | |
run: dart pub get | |
- name: Run l10n | |
run: flutter gen-l10n | |
- name: Publish package | |
run: dart pub publish -v -f | |