Merge from main to dev #21
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: develop CI check | |
| on: | |
| push: | |
| branches: [ "develop" ] | |
| pull_request: | |
| branches: [ "develop" ] | |
| permissions: | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| MYSQL_HOST: 127.0.0.1 | |
| MYSQL_PORT: 3306 | |
| MYSQL_DATABASE: market_db | |
| MYSQL_USER: rivkode | |
| MYSQL_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| REDIS_HOST: 127.0.0.1 | |
| REDIS_PORT: 6379 | |
| REDIS_PASSWORD: "" | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_DATABASE: market_db | |
| MYSQL_USER: rivkode | |
| MYSQL_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| MYSQL_ROOT_PASSWORD: root | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -proot" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=10 | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd="redis-cli ping" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=10 | |
| steps: | |
| - name: 레포지토리 체크아웃 | |
| uses: actions/checkout@v4 | |
| - name: JDK 17 설치 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Gradle Caching | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Wait for MySQL and Redis readiness | |
| run: | | |
| set -e | |
| echo "Waiting for MySQL on 127.0.0.1:3306..." | |
| for i in {1..30}; do | |
| (echo > /dev/tcp/127.0.0.1/3306) >/dev/null 2>&1 && break | |
| sleep 2 | |
| done | |
| (echo > /dev/tcp/127.0.0.1/3306) >/dev/null 2>&1 | |
| echo "Waiting for Redis on 127.0.0.1:6379..." | |
| for i in {1..30}; do | |
| (echo > /dev/tcp/127.0.0.1/6379) >/dev/null 2>&1 && break | |
| sleep 2 | |
| done | |
| (echo > /dev/tcp/127.0.0.1/6379) >/dev/null 2>&1 | |
| - name: Run chmod to make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: 빌드 진행 | |
| run: ./gradlew build -x test | |
| - name: 테스트 코드 실행 | |
| run: ./gradlew --info test | |
| - name: 테스트 결과 PR에 코멘트 작성 | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| files: | | |
| **/build/test-results/**/*.xml | |
| - name: Publish Test Report | |
| uses: mikepenz/action-junit-report@v3 | |
| if: success() || failure() | |
| with: | |
| report_paths: '**/build/test-results/test/TEST-*.xml' |