Repository navigation
119 lines (104 loc) · 4.05 KB
/
Copy pathcodeql-analysis.yml
File metadata and controls
119 lines (104 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: "CodeQL"
on:
pull_request:
push:
branches: [master, 'release-*', 'test-*']
workflow_dispatch:
schedule:
- cron: '33 0 * * 5'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}-${{ github.run_attempt == 1 && 'head' || format('rerun-{0}', github.run_id) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
pull-requests: read
actions: read
security-events: write
jobs:
plan:
runs-on: ubuntu-24.04
outputs:
server: ${{ steps.select.outputs.server }}
commons: ${{ steps.select.outputs.commons }}
pd_store: ${{ steps.select.outputs.pd_store }}
cluster: ${{ steps.select.outputs.cluster }}
docker: ${{ steps.select.outputs.docker }}
helm: ${{ steps.select.outputs.helm }}
dependency_license: ${{ steps.select.outputs.dependency_license }}
compatibility: ${{ steps.select.outputs.compatibility }}
smoke: ${{ steps.select.outputs.smoke }}
security: ${{ steps.select.outputs.security }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- name: Select affected tests
id: select
env:
GH_TOKEN: ${{ github.token }}
run: >-
python3 .github/scripts/ci-policy.py plan --project server
--event-path "$GITHUB_EVENT_PATH" --repository "$GITHUB_REPOSITORY"
--output plan.json
- uses: actions/upload-artifact@v4
with:
name: ci-plan
path: plan.json
retention-days: 7
overwrite: true
analyze:
needs: plan
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || needs.plan.outputs.security == 'true'
env:
USE_STAGE: 'false' # Whether to include the stage repository.
# Preserve the master scan identity when invoked by a reusable-workflow caller.
CODEQL_ACTION_ANALYSIS_KEY: .github/workflows/codeql-analysis.yml:analyze
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'java' ]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup Java JDK
uses: actions/setup-java@v6
with:
distribution: 'zulu'
java-version-file: .github/workflows/.java-version
- name: use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp "$HOME/.m2/settings.xml" /tmp/settings.xml
mv -vf .github/configs/settings.xml "$HOME/.m2/settings.xml"
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: .github/workflows/codeql-analysis.yml:analyze/language:${{ matrix.language }}