[INJI-597] exclude typegen files for sonar check #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Internal Build [Android & IOS] | ||
run-name: ${{ inputs.buildname }} | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release: | ||
description: 'Internal/Beta' | ||
required: true | ||
default: 'internal' | ||
type: choice | ||
options: | ||
- internal | ||
- beta | ||
buildFor: | ||
description: 'Build' | ||
required: true | ||
default: 'Both[Android and IOS]' | ||
type: choice | ||
options: | ||
- Both[Android and IOS] | ||
- Android | ||
- IOS | ||
buildName: | ||
description: 'Build App For' | ||
required: true | ||
default: 'Sprint-x/Collab/release-x.x.x' | ||
type: string | ||
mimotoBackendServiceUrl: | ||
description: 'Mimoto backend service URL' | ||
required: true | ||
default: 'https://api.sandbox.mosip.net' | ||
type: string | ||
esignetBackendServiceUrl: | ||
description: 'Esignet backend service URL' | ||
required: true | ||
default: 'https://api.sandbox.mosip.net' | ||
type: string | ||
injiFlavor: | ||
description: 'Select Inji flavor' | ||
required: true | ||
default: 'Inji' | ||
type: choice | ||
options: | ||
- residentapp | ||
- inji | ||
- collab | ||
- synergy | ||
- mec | ||
internal-testers: | ||
description: 'Internal Testers Group' | ||
required: true | ||
default: 'QA-Triple' | ||
type: choice | ||
options: | ||
- Dev-testing | ||
- MEC | ||
- QA | ||
- MOSIP-Collab | ||
- MOSIP-Dev-testing | ||
theme: | ||
description: 'Application Theme' | ||
required: true | ||
default: 'orange' | ||
type: choice | ||
options: | ||
- orange | ||
- purple | ||
buildDescription: | ||
description: 'What to test' | ||
required: true | ||
default: 'QA-Triple environment' | ||
type: string | ||
allow_env_edit: | ||
description: 'Edit ENV' | ||
required: true | ||
default: 'true' | ||
type: choice | ||
options: | ||
- false | ||
- true | ||
jobs: | ||
build-android: | ||
if: ${{ inputs.buildFor == 'Both[Android and IOS]' || inputs.buildFor == 'Android'}} | ||
uses: mosip/kattu/.github/workflows/android-publish.yml@master | ||
with: | ||
RELEASE: ${{ inputs.release }} | ||
NODE_VERSION: '18.x' | ||
RELEASE_KEYSTORE_ALIAS: androidreleasekey | ||
MIMOTO_HOST: ${{ inputs.mimotoBackendServiceUrl }} | ||
ESIGNET_HOST: ${{ inputs.esignetBackendServiceUrl }} | ||
APPLICATION_THEME: ${{ inputs.theme }} | ||
BUILD_DESCRIPTION: ${{ inputs.buildDescription }} | ||
ALLOW_ENV_EDIT: ${{ inputs.allow_env_edit }} | ||
APP_FLAVOR: ${{ inputs.injiFlavor }} | ||
SERVICE_LOCATION: '.' | ||
ANDROID_SERVICE_LOCATION: 'android' | ||
BUILD_SCRIPT_LOCATION: 'scripts' | ||
SCRIPT_NAME: "./${{ inputs.release }}.sh" | ||
ANDROID_ARTIFACT_NAME: ${{ inputs.buildname }} | ||
ANDROID_ARTIFACT_PATH: "android/app/build/outputs/apk/${{ inputs.injiFlavor }}/release/Inji_universal.apk" | ||
secrets: | ||
ANDROID_KEYSTORE_FILE: ${{ secrets.INJI_ANDROID_RELEASE_KEYSTORE }} | ||
RELEASE_KEYSTORE_PASSWORD: '${{ secrets.INJI_ANDROID_RELEASE_STOREPASS }}' | ||
INJI_ANDROID_PLAY_STORE_CONFIG_JSON: ${{ secrets.INJI_ANDROID_PLAY_STORE_CONFIG_JSON }} | ||
SLACK_WEBHOOK_URL: '${{ secrets.SLACK_WEBHOOK }}' | ||
build-ios: | ||
if: ${{ inputs.buildFor == 'Both[Android and IOS]' || inputs.buildFor == 'IOS'}} | ||
uses: mosip/kattu/.github/workflows/ios-publish.yml@master | ||
with: | ||
NODE_VERSION: '18.x' | ||
MIMOTO_HOST: ${{ inputs.mimotoBackendServiceUrl }} | ||
ESIGNET_HOST: ${{ inputs.esignetBackendServiceUrl }} | ||
APPLICATION_THEME: ${{ inputs.theme }} | ||
TESTFLIGHT_BETA_APP_DESCRIPTION: ${{ inputs.buildDescription }} | ||
ALLOW_ENV_EDIT: ${{ inputs.allow_env_edit }} | ||
TESTFLIGHT_INTERNAL_TESTERS_GROUP: ${{ inputs.internal-testers }} | ||
APP_FLAVOR: ${{ inputs.injiFlavor }} | ||
SERVICE_LOCATION: '.' | ||
IOS_SERVICE_LOCATION: 'ios' | ||
SCRIPT_NAME: "fastlane beta" | ||
IOS_ARTIFACT_NAME: "ios-artifacts" | ||
IOS_ARTIFACT_PATH: "ios/fastlane/Inji_artifacts/" | ||
secrets: | ||
APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}' | ||
DEVELOPER_APP_ID: '${{ secrets.IOS_INJI_DEVELOPER_APP_ID }}' | ||
INJI_IOS_DEVELOPER_APP_IDENTIFIER: '${{ secrets.INJI_IOS_DEVELOPER_APP_IDENTIFIER }}' | ||
INJI_IOS_DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.INJI_IOS_DEVELOPER_PORTAL_TEAM_ID }}' | ||
INJI_IOS_FASTLANE_APPLE_ID: '${{ secrets.INJI_IOS_FASTLANE_APPLE_ID }}' | ||
INJI_IOS_FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.INJI_IOS_FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}' | ||
GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}' | ||
INJI_IOS_PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.INJI_IOS_PROVISIONING_PROFILE_SPECIFIER }}' | ||
INJI_IOS_TEMP_KEYCHAIN_PASSWORD: '${{ secrets.INJI_IOS_TEMP_KEYCHAIN_PASSWORD }}' | ||
INJI_IOS_TEMP_KEYCHAIN_USER: '${{ secrets.INJI_IOS_TEMP_KEYCHAIN_USER }}' | ||
APPLE_KEY_ID: '${{ secrets.APPLE_KEY_ID }}' | ||
APPLE_ISSUER_ID: '${{ secrets.APPLE_ISSUER_ID }}' | ||
APPLE_KEY_CONTENT: '${{ secrets.APPLE_KEY_CONTENT }}' | ||
MATCH_PASSWORD: '${{ secrets.INJI_IOS_MATCH_PASSWORD }}' | ||
SLACK_WEBHOOK_URL: '${{ secrets.SLACK_WEBHOOK }}' | ||
sonar-check: | ||
uses: tw-mosip/kattu/.github/workflows/npm-sonar-analysis.yml@inji-597-customize-npm-sonar-analysis | ||
with: | ||
SERVICE_LOCATION: '.' | ||
NODE_VERSION: '18.x' | ||
NPM_BUILD_TYPE: 'BOB' | ||
secrets: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
ORG_KEY: ${{ secrets.ORG_KEY }} | ||
SLACK_WEBHOOK_URL: '${{ secrets.SLACK_WEBHOOK_INJI_TEAM }}' | ||
check-sonar-critical-issues: | ||
needs: sonar-check | ||
name: Check critical issues in sonar analysis | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install jq | ||
run: sudo apt-get -y install jq | ||
- name: Check for critical bugs | ||
run: | | ||
SONAR_HOST_URL=https://sonarcloud.io | ||
SONAR_PROJECT_KEY=mosip_inji | ||
# sonar check for critical issues is analyzed only for newly created issues. Once the existing critical issues ( use createdBefore=2024-01-04 search) are resolved, this createdAfter can be removed | ||
response=$(curl -s "${SONAR_HOST_URL}/api/issues/search?componentKeys=${SONAR_PROJECT_KEY}&severities=CRITICAL&statuses=OPEN&createdAfter=2024-01-04") | ||
echo "The response is $response" | ||
issues_count=$(echo "$response" | jq '.issues | length') | ||
echo "The number of issues $issues_count" | ||
if [ "$issues_count" -eq 0 ]; then | ||
echo "No critical issues found." | ||
else | ||
echo "Critical issues found. Failing the pipeline" | ||
exit 1 | ||
fi |