Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ "main", "bugfix/*", "feature/*", "release/*" ]
paths:
- 'cardmanagement/**'
- 'cardnetwork/**'
- 'build.gradle'
- 'settings.gradle'
schedule:
- cron: '34 2 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Code Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java-kotlin' ]

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up JDK 11 and 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: |
11
17
cache: gradle

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: security-and-quality

- name: Set git user details
run: |
echo "https://$USERNAME:$PAT@github.com" >> $HOME/.git-credentials
git config --global credential.helper store
git config --global user.name ${USERNAME}
env:
USERNAME: ${{ secrets.CKO_MOBILE_TEAM_USERNAME }}
PAT: ${{ secrets.CKO_MOBILE_TEAM_TOKEN }}

- name: Download and Build Dependency Sian
run: |
# Set the path to clone Levant repository
SIAN_PATH="${RUNNER_TEMP}/dependency-sian"

# Clone the Levant repository using the PAT
git clone https://$USERNAME:$PAT@github.com/cko-mobile/Levant-Android.git ${SIAN_PATH}

# Change directory to the cloned repository
cd ${SIAN_PATH}

# Build AAR and publish to local Maven
./gradlew :sian:assemble

# AAR file is generated in aar directory
cp ./build/outputs/aar/libs/sian-release.aar $GITHUB_WORKSPACE/cardnetwork/sian-release.aar

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Cache Gradle and wrapper
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}

# - name: Cache checkout-sdk-card-network-android.aar
# id: cache-checkout-sdk-card-network-android-aar
# uses: actions/cache@v3
# with:
# path: ./cardnetwork/
# key: ${{ runner.os }}-cache-checkout-sdk-card-network-android
#
# - name: Download checkout-sdk-card-network-android.aar from s3 bucket
# # if there is no cache hit, download the aar from s3 bucket
# if: steps.cache-checkout-sdk-card-network-android-aar.outputs.cache-hit != 'true'
# run: aws s3api get-object --bucket cko-mobile-s3 --key checkout-sdk-card-network-android.aar ./cardnetwork/checkout-sdk-card-network-android.aar

- name: Build Assemble cardmanagement
run: ./gradlew :cardmanagement:assembleDebug

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
1 change: 1 addition & 0 deletions cardmanagement/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ android {

dependencies {
// Add `checkout-sdk-card-management-android`
implementation project(':cardnetwork')

// for Kotlin flow
implementation 'androidx.appcompat:appcompat:1.6.1'
Expand Down
2 changes: 2 additions & 0 deletions cardnetwork/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
configurations.maybeCreate("default")
artifacts.add("default", file('sian-release.aar'))
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
244 changes: 244 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading