-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (76 loc) · 2.66 KB
/
Copy pathcodeql_security_scan.yml
File metadata and controls
94 lines (76 loc) · 2.66 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
name: CodeQL Security Scan
run-name: ${{ github.workflow }} ${{ github.event.repository.updated_at}}
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "00 00 * * 5"
jobs:
analyze:
name: 'CodeQL Security Scan: Analyze (${{ matrix.language }})'
runs-on: ubuntu-latest
permissions:
security-events: write # required for all workflows
packages: read # required to fetch internal or private CodeQL packs
actions: read # only required for workflows in private repositories
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: java-kotlin
build-mode: manual
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create local.properties
run: |
echo ${{ secrets.SIGNING_KEY }} | base64 -d > release_keystore.jks
keystoreFile=$(realpath release_keystore.jks)
echo "keystoreFile: $keystoreFile"
echo "storePassword=${{ secrets.KEY_STORE_PASSWORD }}" >> local.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> local.properties
echo "keyAlias=Keystore" >> local.properties
echo "storeFile=$keystoreFile" >> local.properties
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 21
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2.1.3
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Build CircularDurationView
if: matrix.build-mode == 'manual'
run: bash gradlew :CircularDurationView:assembleDebug
- name: Build App
if: matrix.build-mode == 'manual'
run: bash gradlew :app:assembleDebug
- name: Get AAR Name
run: |
aar=$(find CircularDurationView/build/outputs/aar/*.aar)
echo $aar
echo AAR_PATH=$aar >> $GITHUB_ENV
- name: Get APK Name
run: |
apk=$(find app/build/outputs/apk/debug/*.apk)
echo $apk
echo APK_PATH=$apk >> $GITHUB_ENV
- name: Create Artifacts
uses: actions/upload-artifact@v4
with:
name: build_artifacts
path: |
${{ env.AAR_PATH }}
${{ env.APK_PATH }}
if-no-files-found: error
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"