Skip to content
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

[BE] Github Actions 백엔드 CI 스크립트를 gradle-build-action을 통해 개선한다. #887

Open
yangdongjue5510 opened this issue Dec 10, 2022 · 0 comments

Comments

@yangdongjue5510
Copy link
Collaborator

목표

현재는 리눅스 명령어로 gradle build를 하고 있다.

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v3

      - name: set up JDK
        uses: actions/setup-java@v3
        with:
          java-version: '11'
          distribution: 'temurin'

      - name: grant execute permission for gradlew
        run: chmod +x gradlew

      - name: gradle build
        run: ./gradlew build

gradle-build-action을 사용하면 gradle build에 사용되는 의존성, 로컬 빌드 캐시 등이 캐싱될 수 있다고 한다.
gradle-build-action의 캐싱 기능을 통해 CI 속도를 더 빠르게 할 수 있다.
다음은 github actions CI 공식문서에서 gradle-build-action을 활용한 예시이다.

name: Java CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - name: Set up JDK 11
        uses: actions/setup-java@v3
        with:
          java-version: '11'
          distribution: 'adopt'
      - name: Validate Gradle wrapper
        uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
      - name: Build with Gradle
        uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
        with:
          arguments: build

주의사항(Optional)

실제로 속도가 빨라지는 지 확인해봐야 한다.

@yangdongjue5510 yangdongjue5510 changed the title [BE] Github Actions CI 스크립트를 gradle-build-action을 통해 개선한다. [BE] Github Actions 백엔드 CI 스크립트를 gradle-build-action을 통해 개선한다. Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant