This action is designed to format and test Flutter repositories on pull requests. It helps ensure that your code meets the required quality standards.
Follow the instructions below to integrate this action into your workflow.
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
# Checkout branch
- uses: actions/checkout@v4
# Set up Flutter within the action
- uses: subosito/flutter-action@v2
with:
# See https://github.com/subosito/flutter-action
- uses: ZebraDevs/[email protected]
with:
# Token used for authentication.
token: ${{secrets.GITHUB_TOKEN}}
Name | Description | Required | Default |
---|---|---|---|
token | Token used for pushing fixes and commenting on PRs. | true | |
run-tests | Whether tests should be run. | false | true |
run-analysis | Whether static analysis should be run. | false | true |
run-coverage | Whether code coverage should be run. | false | true |
run-prev-coverage | Whether code coverage should be compared with the base branch - run-coverage must also be true | false | true |
run-behind-by | Whether action should check if HEAD branch is behind base branch. | false | true |
create-comment | Whether the action should comment the output status. | false | true |
working-directory | Working directory to run the action in | false | "." |
coverage-pass-score | Coverage passing percentage | false | "90" |
test-command | Command used to run test suite. | false | "" |
By default, the test-command
input is empty, and the action uses the following command to run tests and generate coverage:
flutter test --coverage --reporter json --coverage-path ${coverageDirectory}/lcov.info
If you provide a custom test-command
, this default behavior is overridden. Note that the ${coverageDirectory}/lcov.info
path for coverage output is not automatically applied when using a custom command. You must ensure that your custom test command handles coverage generation and specifies the appropriate output path if required.
fetch-depth: 0
:
- uses: actions/checkout@v4
with:
fetch-depth: 0
During the action, coverage will be calculated, and lcov.info will be saved in temporary directory
.coverage
. Please refrain from using a top level directory with this path, as this could cause issues.
This project welcomes contributions. Please check out our Contributing guide to learn more on how to get started.
This project is released under the MIT License.