-
Notifications
You must be signed in to change notification settings - Fork 1.1k
85 lines (74 loc) · 2.95 KB
/
codeql.yml
File metadata and controls
85 lines (74 loc) · 2.95 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
name: CodeQL
on:
pull_request:
branches:
- main
- release/*
- cloudfoundry
- gh-pages
push:
branches:
- main
- release/*
- cloudfoundry
- gh-pages
schedule:
- cron: "29 13 * * 2" # weekly at 13:29 UTC on Tuesday
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
permissions:
contents: read
actions: read # for github/codeql-action/init to get workflow details
security-events: write # for github/codeql-action/analyze to upload SARIF results
strategy:
fail-fast: false
matrix:
include:
- language: actions
- language: java
runs-on: ${{ github.repository == 'open-telemetry/opentelemetry-java-instrumentation' && 'oracle-vm-8cpu-32gb-x86-64' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# don't need to free disk space (which takes time) since running on larger machine
- name: Set up JDK 11
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: 11
- name: Set up JDK for running Gradle
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version-file: .java-version
- name: Increase gradle daemon heap size
run: |
# increasing more than other workflows since this is running on a large runner
# and so it uses more parallelism which uses more memory
sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx8g /" gradle.properties
- name: Set up Gradle
if: matrix.language == 'java'
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
with:
cache-read-only: ${{ github.event_name == 'pull_request' }}
- name: Initialize CodeQL
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
with:
languages: ${{ matrix.language }}
# using "linked" helps to keep up with the linked Kotlin support
# see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433
tools: linked
- name: Assemble
if: matrix.language == 'java'
# --no-build-cache is required for codeql to analyze all modules
# --no-daemon is required for codeql to observe the compilation
# (see https://docs.github.com/en/code-security/codeql-cli/getting-started-with-the-codeql-cli/preparing-your-code-for-codeql-analysis#specifying-build-commands)
run: >
./gradlew assemble -x javadoc
--no-build-cache --no-daemon
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
with:
category: "/language:${{matrix.language}}"