Debian Codegraph @

.github/workflows/codeql-java-analysis.yml

raw
1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements. See the NOTICE file distributed with
3 # this work for additional information regarding copyright ownership.
4 # The ASF licenses this file to You under the Apache License, Version 2.0
5 # (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 #
8 # https://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # For most projects, this workflow file will not need changing; you simply need
16 # to commit it to your repository.
17
18 # You may wish to alter this file to override the set of languages analyzed,
19 # or to provide custom queries or build logic.
20
21 name: "CodeQL Java"
22 on:
23 workflow_dispatch:
24 push:
25 branches:
26 - main
27 pull_request:
28 branches:
29 - main
30 paths:
31 - .github/workflows/codeql-java-analysis.yml
32 - lang/java/**
33 - pom.xml
34
35 concurrency:
36 group: ${{ github.workflow }}-${{ github.ref }}
37 cancel-in-progress: true
38
39 jobs:
40 analyze:
41 name: Analyze
42 runs-on: ubuntu-latest
43
44 strategy:
45 fail-fast: false
46 matrix:
47 # Override automatic language detection by changing the below list
48 # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
49 language:
50 - java
51 # Learn more...
52 # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
53
54 steps:
55 - name: Checkout repository
56 uses: actions/checkout@v5
57 with:
58 # We must fetch at least the immediate parents so that if this is
59 # a pull request then we can checkout the head.
60 fetch-depth: 2
61
62 # Initializes the CodeQL tools for scanning.
63 - name: Initialize CodeQL
64 uses: github/codeql-action/init@v3
65 with:
66 languages: ${{ matrix.language }}
67 # If you wish to specify custom queries, you can do so here or in a config file.
68 # By default, queries listed here will override any specified in a config file.
69 # Prefix the list here with "+" to use these queries and those in the config file.
70 # queries: ./path/to/local/query, your-org/your-repo/queries@main
71 queries: +security-and-quality
72
73 - name: 'Setup Temurin JDK 8, 11, 17 & 21'
74 uses: actions/setup-java@v5
75 with:
76 distribution: 'temurin'
77 java-version: |
78 8
79 11
80 17
81 21
82
83 - name: 'Setup Maven 3.9.6'
84 uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
85 with:
86 maven-version: 3.9.6
87
88 # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
89 # If this step fails, then you should remove it and run the build manually (see below)
90 # - name: Autobuild
91 # uses: github/codeql-action/autobuild@v3
92
93 # â„šī¸ Command-line programs to run using the OS shell.
94 # 📚 https://git.io/JvXDl
95
96 # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines
97 # and modify them (or add more) to build your code if your project
98 # uses a compiled language
99 - name: 'Java Test'
100 run: mvn clean test
101
102 - name: Perform CodeQL Analysis
103 uses: github/codeql-action/analyze@v3