Test: 작은, 중간, 큰 금액 포인트 계산 테스트 #178
Workflow file for this run
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
name: Test Server Pull-request # Workflow 이름 | |
on: | |
pull_request: | |
branches: [ "test" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
# Label used to access the service container | |
redis: | |
# Docker Hub image | |
image: redis | |
# Set health checks to wait until redis has started | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps port 6379 on service container to the host | |
- 6379:6379 | |
steps: | |
- name: Checkout source code. # Repo checkout | |
uses: actions/checkout@v3 | |
- name: Set application.properties from secrets | |
run: | | |
echo "${{ secrets.TEST_APPLICATION_PROPERTIES }}" > src/main/resources/application.properties | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew clean build | |
after: | |
runs-on: ubuntu-latest | |
needs: build | |
if: always() | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Comment on failure and close PR | |
if: needs.build.result == 'failure' | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '빌드 실패' | |
}); | |
github.rest.pulls.update({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.payload.pull_request.number, | |
state: 'closed' | |
}); | |
- name: Auto approve pull request | |
if: needs.build.result == 'success' | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.pulls.createReview({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.payload.pull_request.number, | |
event: 'APPROVE' | |
}); |