[Fix] GitHub runner에서 testcontainers가 docker를 찾지 못하는 문제 해결 #284
Workflow file for this run
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: PR 시 CI 테스트 자동화 | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| - main | |
| paths-ignore: | |
| - 'README.md' | |
| jobs: | |
| test: | |
| name: CI | |
| runs-on: ubuntu-latest | |
| permissions: | |
| checks: write | |
| pull-requests: write | |
| steps: | |
| - name: 레포지토리 체크아웃 | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GIT_TOKEN }} | |
| submodules: true | |
| - name: JDK 17 설치 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Gradle 명령 실행 권한 부여 | |
| run: chmod +x ./gradlew | |
| shell: bash | |
| - name: SonarQube 캐싱 | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Gradle 종속성 캐싱 | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
| restore-keys: ${{ runner.os }}-gradle | |
| - name: Gradle Test | |
| run: ./gradlew test | |
| - name: SonarCloud 분석 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: ./gradlew sonar --info --stacktrace | |
| - name: 테스트 결과를 PR 코멘트로 출력 | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| files: '**/build/test-results/test/TEST-*.xml' | |
| - name: 테스트 실패 시, 오류가 발생한 코드 라인에 코멘트 추가 | |
| uses: mikepenz/action-junit-report@v4 | |
| if: always() | |
| with: | |
| report_paths: '**/build/test-results/test/TEST-*.xml' |