diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 32420189..13307b73 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -2,8 +2,8 @@ name: Spring CI for Pull Request on: pull_request: - branches: [ main, dev ] - types: [opened, synchronize, reopened] + branches: [ dev, main ] + types: [ opened, synchronize, reopened ] permissions: contents: write @@ -45,10 +45,10 @@ jobs: - name: Upload JaCoCo report to Codecov uses: codecov/codecov-action@v4 with: - token: ${{ secrets.CODECOV_TOKEN }} # public repo라면 생략 가능 + token: ${{ secrets.CODECOV_TOKEN }} files: build/reports/jacoco/test/jacocoTestReport.xml fail_ci_if_error: true - flags: unittests + flags: pr verbose: true - name: Extract JaCoCo Coverage Percentage diff --git a/.github/workflows/push-ci.yml b/.github/workflows/push-ci.yml new file mode 100644 index 00000000..f914899d --- /dev/null +++ b/.github/workflows/push-ci.yml @@ -0,0 +1,37 @@ +name: Upload Coverage on Push + +on: + push: + branches: [ dev, main ] + +permissions: + contents: read + +jobs: + upload-coverage: + name: Upload Coverage to Codecov + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + + - name: Grant execute permission for gradlew + run: chmod +x ./gradlew + + - name: Run Tests and Generate Coverage + run: ./gradlew clean test jacocoTestReport --no-daemon + + - name: Upload JaCoCo report to Codecov + uses: codecov/codecov-action@v4 + with: + files: build/reports/jacoco/test/jacocoTestReport.xml + fail_ci_if_error: true + flags: dev + verbose: true diff --git a/.gitignore b/.gitignore index 0b241703..4539816f 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,8 @@ spy.log ### Spring Boot ### application.yml + +### node ### +node_modules/ +package-lock.json +package.json \ No newline at end of file