-
Notifications
You must be signed in to change notification settings - Fork 17
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
39 changed files
with
1,928 additions
and
98 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,82 @@ | ||
name: Dart Package Workflow | ||
description: Build and test your Dart packages. | ||
|
||
inputs: | ||
codecov_token: | ||
required: true | ||
description: The Codecov token used to upload coverage | ||
concurrency: | ||
required: false | ||
default: "4" | ||
description: The value of the concurrency flag (-j) used when running tests | ||
coverage_excludes: | ||
required: false | ||
default: "" | ||
description: Globs to exclude from coverage | ||
dart_sdk: | ||
required: false | ||
default: "stable" | ||
description: "The dart sdk version to use" | ||
working_directory: | ||
required: false | ||
default: "." | ||
description: The working directory for this workflow | ||
min_coverage: | ||
required: false | ||
default: "100" | ||
description: The minimum coverage percentage value | ||
analyze_directories: | ||
required: false | ||
default: "lib test" | ||
description: Directories to analyze | ||
report_on: | ||
required: false | ||
default: "lib" | ||
description: Directories to report on when collecting coverage | ||
platform: | ||
required: false | ||
default: "vm" | ||
description: Platform to use when running tests | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{inputs.dart_sdk}} | ||
|
||
- name: Install Dependencies | ||
working-directory: ${{ inputs.working_directory }} | ||
shell: ${{ inputs.shell }} | ||
run: dart pub get | ||
|
||
- name: Format | ||
working-directory: ${{ inputs.working_directory }} | ||
shell: ${{ inputs.shell }} | ||
run: dart format --set-exit-if-changed . | ||
|
||
- name: Analyze | ||
working-directory: ${{ inputs.working_directory }} | ||
shell: ${{ inputs.shell }} | ||
run: dart analyze --fatal-warnings ${{inputs.analyze_directories}} | ||
|
||
- name: Test | ||
working-directory: ${{ inputs.working_directory }} | ||
shell: ${{ inputs.shell }} | ||
run: | | ||
dart pub global activate coverage | ||
dart test -j ${{inputs.concurrency}} --coverage=coverage --platform=${{inputs.platform}} && dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=${{inputs.report_on}} --check-ignore | ||
# Per https://stackoverflow.com/questions/73402042/github-action-expressions-split-string | ||
- name: Split package name | ||
env: | ||
PACKAGE_PATH: ${{ inputs.working_directory}} | ||
id: split | ||
shell: ${{ inputs.shell }} | ||
run: echo "package_name=${PACKAGE_PATH##*/}" >> $GITHUB_OUTPUT | ||
|
||
- name: Upload Coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
flags: ${{ steps.split.outputs.package_name }} | ||
token: ${{ inputs.codecov_token }} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.