Skip to content

[FEAT] 무결성 테스트를 위한 testcontainer 추가 #6

[FEAT] 무결성 테스트를 위한 testcontainer 추가

[FEAT] 무결성 테스트를 위한 testcontainer 추가 #6

Workflow file for this run

# github repository actions 페이지에 나타날 이름
name: Backend CI
# event trigger
# main 브랜치에 push, PR이 되었을 때 workflow 실행
on:
push:
branches: [ "weekly","develop","main" ]
paths : '**'
pull_request:
branches: [ "weekly","develop","main" ]
paths : '**'
permissions: write-all
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: github actions에서 사용할 JDK를 설정합니다.
uses: actions/checkout@v3
with:
java-version: '17'
distribution: 'temurin'
- name: gradlew 실행 권한을 부여합니다.
run: chmod +x gradlew
shell : bash
- name: DB를 실행합니다.
run: |
docker-compose -f resources/local-develop-environment/docker-compose.yml up -d
sleep 20
- name: 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: gradle를 build합니다.
run: ./gradlew build
- name: 테스트 결과를 PR에 코멘트로 등록합니다.
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: '**/build/test-results/test/TEST-*.xml'
- name: 테스트 실패 시, 실패한 코드 라인에 Check 코멘트를 등록합니다.
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
token: ${{ github.token }}
- name: build 실패 시 Slack으로 알립니다.
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: 백엔드 빌드 실패 알림
fields: repo, message, commit, author, action, eventName, ref, workflow, job, took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure()