-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup github actions #3
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: inheritable | ||
|
||
on: | ||
push: | ||
|
||
# env: | ||
# ACTIONS_RUNNER_DEBUG: true | ||
# FLUTTER_VERSION: "2.2.3" | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install and set Flutter version | ||
uses: subosito/[email protected] | ||
with: | ||
channel: 'stable' | ||
|
||
- name: install packages | ||
run: flutter pub get | ||
|
||
- name: Analyze | ||
run: flutter analyze | ||
|
||
- name: prepare test | ||
run: | | ||
./test/coverage_helper.sh | ||
|
||
- name: Run tests | ||
run: | | ||
flutter test --coverage | ||
|
||
# - name: get coverage and prepare percentage for badge | ||
# run: | | ||
# brew install lcov | ||
# PERCENTAGE=$(lcov --remove coverage/lcov.info 'lib/*/*.freezed.dart' 'lib/*/*.g.dart' 'lib/*/*.part.dart' 'lib/generated/*.dart' 'lib/generated/*.*.dart' -o coverage/lcov.info | egrep '\d+.\d+%' | cut -d' ' -f4) | ||
# echo "COVERAGE=${PERCENTAGE}" >> $GITHUB_ENV | ||
|
||
# - name: Create the Badge | ||
# uses: schneegans/[email protected] | ||
# with: | ||
# auth: ${{ secrets.GIST_ACCESS_COVERAGE }} | ||
# gistID: 8a0e501902cba357972bc73b1f911804 | ||
Comment on lines
+37
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any alternatives to this? Could we just create a local badge and display that in the readme. |
||
# filename: capp_bauhaus_coverage_badge_last_run.json | ||
# label: coverage-last-run | ||
# message: ${{ env.COVERAGE }} | ||
# color: blue | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing, EOF new line |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# see https://github.com/flutter/flutter/issues/27997#issue-410722816 | ||
find lib '!' -path '*generated*/*' '!' -name '*.g.dart' '!' -name '*.part.dart' '!' -name '*.freezed.dart' -name '*.dart' | cut -c4- | awk -v package=$1 '{printf "import '\''package:capp_bauhaus%s%s'\'';\n", package, $1}' >> test/coverage_helper_file.dart | ||
|
||
echo "void main(){}" >> test/coverage_helper_file.dart | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing EOF newline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, also the
beta
channel? with optional run so it doesn't block PRs from merging but still helpful to know when things stop working on beta