|
| 1 | +name: "CodeQL" |
| 2 | + |
| 3 | +"on": |
| 4 | + workflow_dispatch: {} |
| 5 | + workflow_call: |
| 6 | + inputs: {} |
| 7 | + secrets: |
| 8 | + GRADLE_CONFIGURATION_KEY: |
| 9 | + description: "Gradle cache key" |
| 10 | + required: false |
| 11 | + BUILDLESS_APIKEY: |
| 12 | + description: "Buildless key" |
| 13 | + required: false |
| 14 | + |
| 15 | + schedule: |
| 16 | + - cron: "0 0-23/2 * * *" |
| 17 | + |
| 18 | + push: |
| 19 | + branches: |
| 20 | + - main |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: read |
| 24 | + |
| 25 | +jobs: |
| 26 | + analyze: |
| 27 | + name: CodeQL |
| 28 | + runs-on: ubuntu-latest |
| 29 | + continue-on-error: true |
| 30 | + permissions: |
| 31 | + actions: read |
| 32 | + contents: read |
| 33 | + security-events: write |
| 34 | + strategy: |
| 35 | + fail-fast: false |
| 36 | + matrix: |
| 37 | + language: ["java-kotlin"] |
| 38 | + steps: |
| 39 | + - name: "Setup: Harden Runner" |
| 40 | + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 |
| 41 | + with: |
| 42 | + egress-policy: audit |
| 43 | + - name: "Setup: Checkout" |
| 44 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 45 | + with: |
| 46 | + persist-credentials: false |
| 47 | + - name: "Setup: Cache Restore (Build)" |
| 48 | + id: cache-restore-build |
| 49 | + uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 |
| 50 | + with: |
| 51 | + key: pkl-v1-build-${{ hashFiles('gradle/libs.versions.toml') }} |
| 52 | + restore-keys: | |
| 53 | + pkl-v1-build-${{ hashFiles('gradle/libs.versions.toml') }} |
| 54 | + pkl-v1-build- |
| 55 | + pkl-v1- |
| 56 | + pkl- |
| 57 | + path: | |
| 58 | + .gradle/ |
| 59 | + build/ |
| 60 | + .codebase/ |
| 61 | + .kotlin/ |
| 62 | + ./*/build/bin |
| 63 | + ./*/build/classes |
| 64 | + ./*/build/kotlin |
| 65 | + ./*/build/klib |
| 66 | + ./*/build/generated |
| 67 | + ./*/build/generated-sources |
| 68 | + - name: "Setup: Java 21" |
| 69 | + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 |
| 70 | + with: |
| 71 | + distribution: 'adopt' |
| 72 | + java-version: '21' |
| 73 | + - name: "Setup: Initialize CodeQL" |
| 74 | + uses: github/codeql-action/init@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3 |
| 75 | + with: |
| 76 | + config-file: ./.github/codeql/codeql-config.yml |
| 77 | + languages: ${{ matrix.language }} |
| 78 | + - name: "Analysis: Build" |
| 79 | + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 |
| 80 | + continue-on-error: true |
| 81 | + env: |
| 82 | + CI: true |
| 83 | + BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }} |
| 84 | + with: |
| 85 | + cache-read-only: true |
| 86 | + cache-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_KEY }} |
| 87 | + arguments: | |
| 88 | + compileKotlin |
| 89 | + compileJava |
| 90 | + assemble |
| 91 | + -x test |
| 92 | + -x check |
| 93 | + - name: "Analysis: CodeQL" |
| 94 | + uses: github/codeql-action/analyze@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3 |
| 95 | + continue-on-error: true |
0 commit comments