Skip to content

Commit

Permalink
Update and rename gradle.yml to testBeforePR.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lth01 authored Apr 25, 2024
1 parent 6bfa9ca commit 91334ca
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 64 deletions.
64 changes: 0 additions & 64 deletions .github/workflows/gradle.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/testBeforePR.yml
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

0 comments on commit 91334ca

Please sign in to comment.