-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and rename gradle.yml to testBeforePR.yml
- Loading branch information
Showing
2 changed files
with
52 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | ||
|
||
name: Test Before PR | ||
|
||
on: | ||
pull_request: | ||
branches: [ master, develop, "feature/**" ] # master branch에 PR을 보낼 때 실행 | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
|
||
# Gradle wrapper 파일 실행 권한주기 | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
# Gradle test를 실행한다 | ||
- name: Test with Gradle | ||
run: ./gradlew --info test | ||
|
||
- name: Compress all report files | ||
if: ${{ failure() }} | ||
run: | | ||
echo "Compressing all report files..." | ||
TIMESTAMP=$(date +%Y%m%d_%H%M%S) | ||
mkdir report_files | ||
REPORT_DIRS=$(find . -type d -path '*/build/reports/tests/test') | ||
for dir in $REPORT_DIRS; do | ||
module_path=$(echo $dir | awk -F'/build/' '{print $1}' | cut -c 3-) | ||
cp -r $dir report_files/$module_path/$(basename $(dirname $dir)) | ||
done | ||
tar czvf report_files_$TIMESTAMP.tar.gz report_files | ||
- name: Upload Error Report Files To Artifacts | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: report_files | ||
path: report_files_*.tar.gz |