Skip to content

feat: 예외 처리 구조 개선 및 stempo-api 모듈 테스트 코드 추가 #78

feat: 예외 처리 구조 개선 및 stempo-api 모듈 테스트 코드 추가

feat: 예외 처리 구조 개선 및 stempo-api 모듈 테스트 코드 추가 #78

name: Spring Boot Gradle CI
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: '21'
distribution: 'adopt'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set up Gradle Cache
uses: actions/cache@v4
with:
path: ~/.gradle/caches/modules-2/files-2.1
key: gradle-${{ runner.os }}-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-build
gradle-${{ runner.os }}
- name: Create application-test.yml from secret for stempo-common
env:
COMMON_TEST_YML: ${{ secrets.COMMON_TEST_YML }}
COMMON_TEST_DIR: ./stempo-common/src/test/resources
COMMON_DIR_FILE_NAME: application-test.yml
run: |
mkdir -p $COMMON_TEST_DIR
echo $COMMON_TEST_YML | base64 --decode > $COMMON_TEST_DIR/$COMMON_DIR_FILE_NAME
- name: Create application-test.yml from secret for stempo-infrastructure
env:
INFRA_TEST_YML: ${{ secrets.INFRA_TEST_YML }}
INFRA_TEST_DIR: ./stempo-infrastructure/src/test/resources
INFRA_DIR_FILE_NAME: application-test.yml
run: |
mkdir -p $INFRA_TEST_DIR
echo $INFRA_TEST_YML | base64 --decode > $INFRA_TEST_DIR/$INFRA_DIR_FILE_NAME
- name: Create application-test.yml from secret for stempo-auth
env:
AUTH_TEST_YML: ${{ secrets.AUTH_TEST_YML }}
AUTH_TEST_DIR: ./stempo-auth/src/test/resources
AUTH_DIR_FILE_NAME: application-test.yml
run: |
mkdir -p $AUTH_TEST_DIR
echo $AUTH_TEST_YML | base64 --decode > $AUTH_TEST_DIR/$AUTH_DIR_FILE_NAME
- name: Run tests with Gradle
run: ./gradlew test -Dspring.profiles.active=test --info --parallel
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: '**/build/reports/tests/test/*'
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: '21'
distribution: 'adopt'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assemble --info --parallel
- name: Check build status
run: |
if [[ $? -ne 0 ]]; then
echo "Build failed!"
exit 1
else
echo "Build succeeded!"
fi