Merge pull request #216 from YAPP-Github/refactor/PRODUCT-287 #433
This file contains hidden or 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: sonarCloud | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| env: | |
| AWS_REGION: ap-northeast-2 | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Get TEST_JWT_SECRET_KEY from SSM | |
| id: get-test-secret | |
| run: | | |
| SECRET_VALUE=$(aws ssm get-parameter \ | |
| --name "/common/TEST_JWT_SECRET_KEY" \ | |
| --with-decryption \ | |
| --region "${{ env.AWS_REGION }}" \ | |
| --query "Parameter.Value" \ | |
| --output text) | |
| echo "TEST_JWT_SECRET_KEY=$SECRET_VALUE" >> $GITHUB_ENV | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x ./gradlew | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Run tests and SonarCloud scan | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| TEST_JWT_SECRET_KEY: ${{ env.TEST_JWT_SECRET_KEY }} | |
| run: ./gradlew test jacocoTestReport sonar --info |