|
1 | 1 | name: "CodeQL" |
2 | 2 |
|
3 | | -permissions: |
4 | | - contents: read |
5 | | - actions: read |
6 | | - security-events: write |
7 | | - |
8 | 3 | on: |
9 | 4 | push: |
10 | | - branches: ["main"] |
| 5 | + branches: [ "main" ] |
11 | 6 | pull_request: |
12 | | - branches: ["main"] |
| 7 | + branches: [ "main" ] |
13 | 8 | schedule: |
14 | | - - cron: "0 3 * * 1" |
| 9 | + - cron: '0 3 * * 1' |
15 | 10 |
|
16 | 11 | jobs: |
17 | 12 | analyze: |
18 | 13 | name: Analyze |
19 | 14 | runs-on: ubuntu-latest |
| 15 | + permissions: |
| 16 | + actions: read |
| 17 | + contents: read |
| 18 | + security-events: write |
20 | 19 |
|
21 | 20 | strategy: |
22 | 21 | fail-fast: false |
23 | 22 | matrix: |
24 | | - language: ["java"] |
| 23 | + language: [ 'java' ] |
25 | 24 |
|
26 | 25 | steps: |
27 | | - - name: Checkout repository |
28 | | - uses: actions/checkout@v3 |
| 26 | + - name: Checkout repository |
| 27 | + uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 30 | + |
| 31 | + - name: Set up JDK 17 |
| 32 | + uses: actions/setup-java@v4 |
| 33 | + with: |
| 34 | + java-version: '17' |
| 35 | + distribution: 'temurin' |
| 36 | + |
| 37 | + - name: Install Groovy |
| 38 | + run: sudo apt-get update && sudo apt-get install -y groovy |
29 | 39 |
|
30 | | - - name: Set up JDK 17 |
31 | | - uses: actions/setup-java@v3 |
32 | | - with: |
33 | | - java-version: "17" |
34 | | - distribution: "temurin" |
35 | | - cache: "maven" |
| 40 | + - name: Clone and build apis-bom |
| 41 | + run: | |
| 42 | + git clone https://github.com/hyphae/apis-bom.git ../apis-bom |
| 43 | + cd ../apis-bom |
| 44 | + mvn -B clean install |
36 | 45 |
|
37 | | - - name: Install Groovy |
38 | | - run: sudo apt-get update && sudo apt-get install -y groovy |
| 46 | + - name: Clone and build apis-common |
| 47 | + run: | |
| 48 | + git clone https://github.com/hyphae/apis-common.git ../apis-common |
| 49 | + cd ../apis-common |
| 50 | + BOM_VERSION=$(grep -oP '<version>\K[^<]+' ../apis-bom/pom.xml | head -1) |
| 51 | + sed -i "s/<version>3.0.0<\\/version>/<version>$BOM_VERSION<\\/version>/" pom.xml |
| 52 | + mvn -B clean install |
39 | 53 |
|
40 | | - - name: Initialize CodeQL |
41 | | - uses: github/codeql-action/init@v2 |
42 | | - with: |
43 | | - languages: ${{ matrix.language }} |
| 54 | + - name: Initialize CodeQL |
| 55 | + uses: github/codeql-action/init@v3 |
| 56 | + with: |
| 57 | + languages: ${{ matrix.language }} |
44 | 58 |
|
45 | | - - name: Autobuild |
46 | | - uses: github/codeql-action/autobuild@v2 |
| 59 | + - name: Build for CodeQL Analysis |
| 60 | + run: | |
| 61 | + mvn -B clean compile test-compile |
47 | 62 |
|
48 | | - - name: Perform CodeQL Analysis |
49 | | - uses: github/codeql-action/analyze@v2 |
| 63 | + - name: Perform CodeQL Analysis |
| 64 | + uses: github/codeql-action/analyze@v3 |
0 commit comments