-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
122 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: CI & CD | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
push: | ||
branches: [develop, main] | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+*" | ||
|
||
pull_request: | ||
branches: [develop, 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: | ||
name: Build package & run tests | ||
runs-on: ubuntu-latest | ||
|
||
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: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
architecture: x64 | ||
cache: true | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Format code | ||
run: dart format --set-exit-if-changed . | ||
|
||
- 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 | ||
|
||
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: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
architecture: x64 | ||
cache: true | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Build example | ||
run: flutter build appbundle --debug | ||
working-directory: example | ||
|
||
deployment: | ||
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 | ||
|
||
- name: Set up Dart | ||
uses: dart-lang/setup-dart@v1 | ||
|
||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
architecture: x64 | ||
cache: true | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Publish package | ||
run: dart pub publish -v -f |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,15 @@ | ||
# This file configures the analyzer, which statically analyzes Dart code to | ||
# check for errors, warnings, and lints. | ||
# | ||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled | ||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be | ||
# invoked from the command line by running `flutter analyze`. | ||
|
||
# The following line activates a set of recommended lints for Flutter apps, | ||
# packages, and plugins designed to encourage good coding practices. | ||
include: package:flutter_lints/flutter.yaml | ||
analyzer: | ||
errors: | ||
missing_required_param: error | ||
missing_return: error | ||
todo: ignore | ||
|
||
linter: | ||
# The lint rules applied to this project can be customized in the | ||
# section below to disable rules from the `package:flutter_lints/flutter.yaml` | ||
# included above or to enable additional rules. A list of all available lints | ||
# and their documentation is published at https://dart.dev/lints. | ||
# | ||
# Instead of disabling a lint rule for the entire project in the | ||
# section below, it can also be suppressed for a single line of code | ||
# or a specific dart file by using the `// ignore: name_of_lint` and | ||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file | ||
# producing the lint. | ||
rules: | ||
# avoid_print: false # Uncomment to disable the `avoid_print` rule | ||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options | ||
one_member_abstracts: false | ||
prefer_relative_imports: true | ||
always_use_package_imports: false | ||
omit_local_variable_types: false | ||
directives_ordering: true | ||
|
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
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