-
-
Notifications
You must be signed in to change notification settings - Fork 490
ci: migrate lint reporting to SARIF and remove Danger #1061
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
Changes from 1 commit
5e199a5
a0637b3
197e34a
6d110bf
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 |
|---|---|---|
|
|
@@ -11,25 +11,30 @@ jobs: | |
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 100 | ||
|
|
||
| - uses: actions/setup-java@v3 | ||
| - uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '11' | ||
| distribution: 'zulu' | ||
| java-version: | | ||
| 17 | ||
| 21 | ||
|
|
||
| - name: Validate gradle wrapper | ||
| uses: gradle/wrapper-validation-action@v1 | ||
| uses: gradle/actions/wrapper-validation@v6 | ||
|
|
||
| - name: Copy CI gradle.properties | ||
| run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | ||
|
|
||
| - name: Gradle Build Cache | ||
| uses: gradle/gradle-build-action@v2 | ||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v6 | ||
|
|
||
| - name: Build Debug | ||
| run: ./gradlew clean app:assembleDebug | ||
|
|
@@ -38,24 +43,25 @@ jobs: | |
| if: github.event_name == 'pull_request' | ||
| run: ./gradlew lintDebug | ||
|
|
||
| - name: Detekt | ||
| if: github.event_name == 'pull_request' | ||
| run: ./gradlew detekt | ||
|
|
||
| - name: Setup Ruby | ||
| if: github.event_name == 'pull_request' | ||
| uses: ruby/setup-ruby@v1 | ||
| - name: Collect Lint SARIF reports | ||
| if: github.event_name == 'pull_request' | ||
| run: | | ||
| mkdir -p sarif-reports | ||
| find . -name "lint-results-debug.sarif" | while read f; do | ||
|
||
| module=$(echo "$f" | sed 's|^\./||' | sed 's|/build/reports/.*||' | sed 's|/|-|g') | ||
| cp "$f" "sarif-reports/${module}-lint.sarif" | ||
| done | ||
|
|
||
| - name: Upload Lint SARIF | ||
| if: always() && github.event_name == 'pull_request' | ||
| uses: github/codeql-action/upload-sarif@v4 | ||
| with: | ||
| ruby-version: '3.0' | ||
| bundler-cache: true | ||
| sarif_file: 'sarif-reports' | ||
|
||
| category: android-lint | ||
|
|
||
| - name: Run Danger | ||
| - name: Detekt | ||
| if: github.event_name == 'pull_request' | ||
| run: | | ||
| gem install danger | ||
| bundle exec danger --dangerfile=Dangerfile --danger_id=danger-pr | ||
| env: | ||
| DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: ./gradlew detekt | ||
|
|
||
| - name: Prepare Keystore and Local. | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
|
|
@@ -105,7 +111,7 @@ jobs: | |
| find . -name "*.aab" -type f -exec cp {} "artifacts" \; | ||
|
|
||
| - name: Archive Artifacts | ||
| uses: actions/upload-artifact@v3 | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: "App-Artifacts" | ||
| path: artifacts/* | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: PR Checks | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| quality-gates: | ||
| name: Quality Gates | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: PR Quality Gates | ||
| uses: actions/github-script@v8 | ||
| with: | ||
| script: | | ||
| const { data: pr } = await github.rest.pulls.get({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: context.issue.number | ||
| }); | ||
| const labels = pr.labels.map(l => l.name); | ||
| if (labels.some(l => l.includes('DO NOT MERGE'))) | ||
| core.setFailed('PR specifies label DO NOT MERGE'); | ||
| if (labels.some(l => l.includes('Engineers at work')) || pr.title.includes('[WIP]')) | ||
| core.warning('PR is marked as Work in Progress'); | ||
| if (pr.additions + pr.deletions > 5000) | ||
| core.warning('Big PR'); |
This file was deleted.
This file was deleted.
This file was deleted.
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.
actions/setup-javadoes not reliably support installing multiple JDKs via a multi-linejava-version, and this workflow also requests JDK 21 while the repo is pinned to Gradle 7.5.1 (which is not compatible with running on Java 21). Use a single supported JDK (e.g., 11/17), or switch to a matrix and/or upgrade the Gradle wrapper (and AGP) if Java 21 is required.