Update README.md #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
on: | |
push: | |
branches: [ "develop"] | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
jobs: | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
steps: | |
- name: Github checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: docker-compose-test up | |
run: | | |
pwd | |
echo '도커 컴포즈 테스트 up' | |
docker-compose -f docker-compose-test.yml up -d | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
# 서비스에 필요한 yml 파일 생성 | |
# application-oauth.yml 생성 | |
- name: Make application-oauth.yml | |
run: | | |
cd ./src/main/resources | |
touch ./application-oauth.yml | |
echo "${{ secrets.YML_DEV_OAUTH }}" > ./application-oauth.yml | |
shell: bash | |
# application-aws.yml 생성 | |
- name: Make application-aws.yml | |
run: | | |
cd ./src/main/resources | |
touch ./application-aws.yml | |
echo "${{ secrets.YML_DEV_AWS }}" > ./application-aws.yml | |
shell: bash | |
# application-actuator.yml 생성 | |
- name: Make application-actuator.yml | |
run: | | |
cd ./src/main/resources | |
touch ./application-actuator.yml | |
echo "${{ secrets.YML_DEV_ACTUATOR }}" > ./application-actuator.yml | |
shell: bash | |
# application-rds.yml 생성 | |
- name: Make application-rds.yml | |
run: | | |
cd ./src/main/resources | |
touch ./application-rds.yml | |
echo "${{ secrets.YML_DEV_RDS }}" > ./application-rds.yml | |
shell: bash | |
- name: Make Test application.yml | |
run: | | |
mkdir ./src/test/resources | |
cd ./src/test/resources | |
touch ./application.yml | |
echo "${{ secrets.YML_TEST }}" > ./application.yml | |
shell: bash | |
- name: Run gradle test | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: clean test | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
if: always() | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Build and analyze | |
uses: gradle/gradle-build-action@v2 | |
if: always() | |
with: | |
arguments: sonar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Write 'PR comment' on test results automatically | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: build/test-results/test/TEST-*.xml | |
- name: Write 'PR check' on failure test automatically | |
uses: mikepenz/action-junit-report@v3 | |
if: failure() | |
with: | |
report_paths: build/test-results/test/TEST-*.xml |