From 24bc4b2d9623488bd878a952bfa7d6bb704479cd Mon Sep 17 00:00:00 2001 From: Minseong Park <52368015+pminsung12@users.noreply.github.com> Date: Thu, 4 Jul 2024 00:49:06 +0900 Subject: [PATCH] =?UTF-8?q?[BSVR-62]=20=EA=B0=9C=EB=B0=9C=EB=8B=A8?= =?UTF-8?q?=EA=B3=84=20ci=20github=20actions=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80=20(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: build와 test 단계를 포함하는 개발단계 CI Publish Unit Test Results, JUnit Report Action, Store test results, Test Report Summary 포함. * fix: pr labeler 트리거 이벤트 한정 pr labeler가 테스트 결과에도 돌아서 수정. * build: github action workflow group 수정 * chore: concurrency 이슈 확인 * fix: 문제가 되는 concurrency 삭제 --------- Co-authored-by: EunjiShin --- .github/workflows/dev-ci.yaml | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/dev-ci.yaml diff --git a/.github/workflows/dev-ci.yaml b/.github/workflows/dev-ci.yaml new file mode 100644 index 00000000..68b7ca8a --- /dev/null +++ b/.github/workflows/dev-ci.yaml @@ -0,0 +1,71 @@ +name: Build And Test + +on: + push: + branches: + - dev + - main + pull_request: + branches: + - dev + - main + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: "17" + distribution: "corretto" + + - name: Cache Gradle + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew build -x test --stacktrace --parallel + + - name: Run tests + run: ./gradlew test + + - name: Publish Unit Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: '**/build/test-results/test/TEST-*.xml' + + - name: JUnit Report Action + uses: mikepenz/action-junit-report@v3 + if: always() + with: + report_paths: '**/build/test-results/test/TEST-*.xml' + + - name: Store test results + uses: actions/upload-artifact@v3 + if: always() + with: + name: test-results + path: '**/build/test-results/test/TEST-*.xml' + + - name: Test Report Summary + if: always() + run: | + echo '## Test Report Summary' >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + ./gradlew test --console=plain || true + echo '```' >> $GITHUB_STEP_SUMMARY \ No newline at end of file