Skip to content
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

ci: re-enable package analyzer #1918

Merged
merged 10 commits into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 30 additions & 33 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,33 @@ jobs:

- run: dart doc --dry-run

# Currently Disabled because of git error `detected dubious ownership in repository.
# TODO: check if this is still an issue when git version in github runners is updated
#
# package-analysis:
# # `axel-op/dart-package-analyzer` is using `flutter pub upgrade` instead of `get`,
# # which ignores pubspec.yaml `dependency_overrides`. Because of that, all `release/*` branches are failing,
# # because the package cannot find the "about to be released" version of our sentry-dart package that it depends on.
# if: ${{ !startsWith(github.ref, 'refs/heads/release/') && inputs.panaThreshold > 0 }}
# runs-on: ubuntu-20.04
# timeout-minutes: 20
# steps:
# - uses: actions/checkout@v4
# - name: Apply dependency override
# if: ${{ inputs.package == 'flutter' }}
# working-directory: ${{ inputs.package }}
# run: |
# sed -i.bak 's|sentry:.*|sentry:\n path: /github/workspace/dart|g' pubspec.yaml
# - uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3
# id: analysis
# with:
# githubToken: ${{ secrets.GITHUB_TOKEN }}
# relativePath: ${{ inputs.package }}
# - name: Check scores
# env:
# TOTAL: ${{ steps.analysis.outputs.total }}
# TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
# run: |
# PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
# if (( $PERCENTAGE < ${{ inputs.panaThreshold }} ))
# then
# echo Score too low!
# exit 1
# fi
package-analysis:
# `axel-op/dart-package-analyzer` is using `flutter pub upgrade` instead of `get`,
# which ignores pubspec.yaml `dependency_overrides`. Because of that, all `release/*` branches are failing,
# because the package cannot find the "about to be released" version of our sentry-dart package that it depends on.
if: ${{ !startsWith(github.ref, 'refs/heads/release/') && inputs.panaThreshold > 0 }}
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Apply dependency override
if: ${{ inputs.package == 'flutter' }}
working-directory: ${{ inputs.package }}
run: |
sed -i.bak 's|sentry:.*|sentry:\n path: /github/workspace/dart|g' pubspec.yaml
- uses: axel-op/dart-package-analyzer@d9b13539ce28b8a2f85605379ce8670209d571e8 # pin@v3
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
relativePath: ${{ inputs.package }}
- name: Check scores
env:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
if (( $PERCENTAGE < ${{ inputs.panaThreshold }} ))
then
echo Score too low!
exit 1
fi
Loading