-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: develop PR on check workflow 작성 #7
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ee9bae8
chore: develop PR on check workflow 작성
char-yb 49d811c
fix: jdk zulu로 변경
char-yb e47752f
chore: slack webhook Test
char-yb 06533d1
chore: slack webhook Test
char-yb 4cae00a
chore: slack webhook Test
char-yb fb1836d
chore: cache-read-only false 옵션
char-yb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,39 @@ | ||
name: Pull Request on Check | ||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java-version: [ 17 ] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.java-version }} | ||
distribution: 'zulu' | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x ./gradlew | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
arguments: check | ||
cache-read-only: false | ||
## slack 알람 | ||
- name: Slack Alarm | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
author_name: GitHub-Actions CI/CD | ||
fields: repo,message,commit,author,ref,job,took | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required | ||
if: always() # Pick up events even if the job fails or is canceled. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사소한데 혹시 develop만 지정한 이유가 있을까요?? 마지막 부분에 main, develop 을 제외하는 코드가 있는데 이 부분의 의도가 궁금해요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kwanok develop만 지정한 이유는 main과 별개의 CI workflow를 하기 위함도 있을 수 있지만,
굳이 main 또는 release 브랜치에 작업된 내용을 직접적으로 바로 찌르지 않고 develop에서 CI 과정이 검증되었다고 생각했습니당
main과 develop을 제외하는 코드는 build-action에서 캐시를 읽기전용만을 사용하기 위함이에용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
상세한 설명 감사드려요. 😊 추가적으로 궁금한 게
cache-read-only
조건문은 불필요하지 않을까...? 생각했어요. 아래와 같이 변경하는 건 어떻게 생각하시나요?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
괜찮을 거 같아용
현재 작성된 워크플로는 develop으로 PR을 올렸을 때 CI가 발생되는데, 발생될 일이 없어보이네요:)
다만, main(production), develop으로 CI/CD가 이뤄진 경우에서는 cache-read-only를 사용하려는 의도가 맞을까용??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 넵넵 처음에 올려주신 코드를 보고 개인적으로 느낀 점은
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵넵 1번대로 main, develop은
해당 코드 상태여도 빌드가 클린한 상태로 시작하고, 그 외는 캐싱을 하고 있습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵넵 ㅎㅎ 그래서 처음에 드렸던 말은 어차피 develop branch에만 적용되는 워크플로우라서
${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
는 항상 false이니, 중복된 조건으로 인한 스크립트의 복잡도를 낮추려는 의도였습니다!그래서 이 부분은 사소하다고 생각하고 다양하게 해석할 수 있다고 생각해요. 그대로 두어도 된다고 봅니다!