analysis.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # synced from @nextcloud/android-config
  2. # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
  3. # SPDX-FileCopyrightText: 2023 Tobias Kaminsky <tobias@kaminsky.me>
  4. # SPDX-FileCopyrightText: 2023 Andy Scherzinger <info@andy-scherzinger.de>
  5. # SPDX-FileCopyrightText: 2023 Josh Richards <josh.t.richards@gmail.com>
  6. # SPDX-License-Identifier: GPL-3.0-or-later
  7. name: "Analysis"
  8. on:
  9. pull_request:
  10. branches: [ "master", "main", "stable-*" ]
  11. push:
  12. branches: [ "master", "main", "stable-*" ]
  13. permissions:
  14. pull-requests: write
  15. contents: write
  16. concurrency:
  17. group: analysis-wrapper-${{ github.head_ref || github.run_id }}
  18. cancel-in-progress: true
  19. jobs:
  20. analysis:
  21. runs-on: ubuntu-24.04
  22. steps:
  23. - name: Setup variables
  24. id: get-vars
  25. run: |
  26. if [ -z "$GITHUB_HEAD_REF" ]; then
  27. # push
  28. {
  29. echo "branch=$GITHUB_REF_NAME"
  30. echo "pr=$GITHUB_RUN_ID"
  31. echo "repo=${{ github.repository }}"
  32. } >> "$GITHUB_OUTPUT"
  33. else
  34. # pull request
  35. {
  36. echo "branch=$GITHUB_HEAD_REF"
  37. echo "pr=${{ github.event.pull_request.number }}"
  38. echo "repo=${{ github.event.pull_request.head.repo.full_name }}"
  39. } >> "$GITHUB_OUTPUT"
  40. fi
  41. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  42. with:
  43. repository: ${{ steps.get-vars.outputs.repo }}
  44. ref: ${{ steps.get-vars.outputs.branch }}
  45. - name: Set up JDK 17
  46. uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
  47. with:
  48. distribution: "temurin"
  49. java-version: 17
  50. - name: Install dependencies
  51. run: |
  52. sudo apt install python3-defusedxml
  53. - name: Run analysis wrapper
  54. env:
  55. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  56. run: |
  57. mkdir -p "$HOME/.gradle"
  58. echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
  59. scripts/analysis/analysis-wrapper.sh ${{ steps.get-vars.outputs.branch }} ${{ secrets.LOG_USERNAME }} ${{ secrets.LOG_PASSWORD }} "$GITHUB_RUN_NUMBER" ${{ steps.get-vars.outputs.pr }}