-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ASC-18278 - Implement Sonar Scan
- Loading branch information
Showing
6 changed files
with
204 additions
and
110 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: SonarCloud Scan | ||
description: SonarCloud Scan action. | ||
|
||
inputs: | ||
SONAR_SCANNER_VERSION: | ||
description: SonarCloud Scanner version | ||
default: 5.0.1.3006 | ||
SONAR_HOST: | ||
description: SonarCloud Scanner version | ||
default: https://sonarcloud.io | ||
SONAR_TOKEN: | ||
description: SonarCloud user token | ||
required: true | ||
SONAR_ScanningDirectory: | ||
description: Base Directory for Scanner | ||
SONAR_QualityGate_Wait: | ||
description: SonarCloud Scanner wait for QualityGate | ||
default: 'false' | ||
SONAR_QualityGate_Timeout: | ||
description: SonarCloud Scanner QualityGate polling timeout | ||
default: '3000' | ||
NODE_VERSION: | ||
description: Node version | ||
default: '18' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# Install SonarCloud Scanner | ||
- name: Install SonarCloud Scanner | ||
shell: bash | ||
run: | | ||
export SONAR_SCANNER_VERSION=${{ inputs.SONAR_SCANNER_VERSION }} | ||
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux | ||
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip | ||
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ | ||
export PATH=$SONAR_SCANNER_HOME/bin:$PATH | ||
export SONAR_SCANNER_OPTS="-server" | ||
# Run the SonarCloud scan | ||
- name: SonarCloud Scan | ||
working-directory: ${{ inputs.SONAR_ScanningDirectory }} | ||
shell: bash | ||
run: | | ||
export SONAR_SCANNER_VERSION=${{ inputs.SONAR_SCANNER_VERSION }} | ||
export SONAR_SCANNER_BIN=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin | ||
$SONAR_SCANNER_BIN/sonar-scanner \ | ||
-Dsonar.host.url=${{ inputs.SONAR_HOST }} \ | ||
-Dsonar.token=${{ inputs.SONAR_TOKEN }} \ | ||
-Dsonar.projectBaseDir=${{ inputs.SONAR_ScanningDirectory }} \ | ||
-Dsonar.qualitygate.wait=${{ inputs.SONAR_QualityGate_Wait }} \ | ||
-Dsonar.qualitygate.timeout=${{ inputs.SONAR_QualityGate_Timeout }} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
sonar.projectKey=amity-social-UIKit-react-native-cli-opensource | ||
sonar.organization=amityco | ||
sonar.projectName=Amity Social Cloud: UIKit Ract Native CLI Opensource | ||
sonar.sources=./src | ||
sonar.test=./tests | ||
sonar.exclusions = **/*.java,**/node_modules/**,**/*.spec.ts,**/*.spec.tsx,**/*.spec.js,**/*.spec.jsx,**/*.stories.tsx,**/*.stories.ts,**/*.stories.js,**/*.stories.js,scripst/**,coverage/** | ||
sonar.test.inclusions=**/*.spec.ts | ||
sonar.javascript.lcov.reportPaths=**/lcov.info |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test('Always Pass', () => { | ||
expect(true).toBe(true); | ||
}); |