|
| 1 | +# For most projects, this workflow file will not need changing; you simply need |
| 2 | +# to commit it to your repository. |
| 3 | +# |
| 4 | +# You may wish to alter this file to override the set of languages analyzed, |
| 5 | +# or to provide custom queries or build logic. |
| 6 | +# |
| 7 | +# ******** NOTE ******** |
| 8 | +# We have attempted to detect the languages in your repository. Please check |
| 9 | +# the `language` matrix defined below to confirm you have the correct set of |
| 10 | +# supported CodeQL languages. |
| 11 | +# |
1 | 12 | name: "CodeQL" |
2 | 13 |
|
3 | 14 | on: |
4 | | - workflow_dispatch: |
5 | 15 | push: |
6 | | - branches: [dev, master] |
| 16 | + branches: [ "dev", "master" ] |
7 | 17 | pull_request: |
8 | 18 | # The branches below must be a subset of the branches above |
9 | | - branches: [dev] |
| 19 | + branches: [ "dev" ] |
10 | 20 | schedule: |
11 | 21 | - cron: '0 1 * * 4' |
| 22 | + workflow_dispatch: |
12 | 23 |
|
13 | 24 | jobs: |
14 | 25 | analyze: |
15 | 26 | name: Analyze |
16 | | - runs-on: ubuntu-latest |
| 27 | + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} |
| 28 | + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} |
| 29 | + permissions: |
| 30 | + actions: read |
| 31 | + contents: read |
| 32 | + security-events: write |
| 33 | + |
| 34 | + strategy: |
| 35 | + fail-fast: false |
| 36 | + matrix: |
| 37 | + language: [ 'java' ] |
| 38 | + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ] |
| 39 | + # Use only 'java' to analyze code written in Java, Kotlin or both |
| 40 | + # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both |
| 41 | + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support |
17 | 42 |
|
18 | 43 | steps: |
19 | 44 | - name: Checkout repository |
20 | | - uses: actions/checkout@v3 |
| 45 | + uses: actions/checkout@v4 |
21 | 46 |
|
22 | | - - uses: actions/setup-java@v3 |
| 47 | + - name: Set up JDK |
| 48 | + uses: actions/setup-java@v3 |
23 | 49 | with: |
24 | | - distribution: 'adopt' |
25 | | - java-version: 18 |
| 50 | + java-version: 20 |
| 51 | + distribution: 'temurin' |
| 52 | + cache: gradle |
26 | 53 |
|
27 | 54 | # Initializes the CodeQL tools for scanning. |
28 | 55 | - name: Initialize CodeQL |
29 | 56 | uses: github/codeql-action/init@v2 |
30 | | - # Override language selection by uncommenting this and choosing your languages |
31 | 57 | with: |
32 | | - languages: java |
| 58 | + languages: ${{ matrix.language }} |
| 59 | + # If you wish to specify custom queries, you can do so here or in a config file. |
| 60 | + # By default, queries listed here will override any specified in a config file. |
| 61 | + # Prefix the list here with "+" to use these queries and those in the config file. |
33 | 62 |
|
34 | | - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). |
| 63 | + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs |
| 64 | + # queries: security-extended,security-and-quality |
| 65 | + |
| 66 | + |
| 67 | + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). |
35 | 68 | # If this step fails, then you should remove it and run the build manually (see below) |
36 | | - - name: Autobuild |
37 | | - uses: github/codeql-action/autobuild@v2 |
| 69 | + # - name: Autobuild |
| 70 | + # uses: github/codeql-action/autobuild@v2 |
38 | 71 |
|
39 | 72 | # ℹ️ Command-line programs to run using the OS shell. |
40 | | - # 📚 https://git.io/JvXDl |
| 73 | + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
41 | 74 |
|
42 | | - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines |
43 | | - # and modify them (or add more) to build your code if your project |
44 | | - # uses a compiled language |
| 75 | + # If the Autobuild fails above, remove it and uncomment the following three lines. |
| 76 | + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. |
45 | 77 |
|
46 | | - #- run: | |
47 | | - # make bootstrap |
48 | | - # make release |
| 78 | + - name: Grant execute permission for gradlew |
| 79 | + run: chmod +x gradlew |
| 80 | + - name: Build with Gradle |
| 81 | + run: ./gradlew build |
49 | 82 |
|
50 | 83 | - name: Perform CodeQL Analysis |
51 | 84 | uses: github/codeql-action/analyze@v2 |
| 85 | + with: |
| 86 | + category: "/language:${{matrix.language}}" |
0 commit comments