Image
CI\CD/GitHub Actions

[GitHub Actions] Workflow 실행이 Cancel되거나 Skip되는 경우 알아보기

Workflow가 Cancel 되는 경우

Job이 실패하는 경우

Job이 Fail 되면 Workflow는 Cancel 된다. Job은 하나 이상의 Step이 Fail되면 Job은 자동으로 Fail된다. 또한 해당 Job을 필요로 하는 Job 또한 모두 실패한다. 

 

직접 취소를 시키는 경우

Cancel workflow 버튼을 눌러 직접 Workflow를 취소 할 수 있다.

 

 

 

Workflow가 취소 되었을 때 다시 실행하기

위에서 Cancel workflow 버튼을 누르면 아래와 같은 취소 화면이 뜬다. 

 

 

여기서 Re-run jobs 를 누르면 실패한 Job을 다시 실행하거나 Workflow 자체를 처음부터 다시 실행 할 수 있다.

  • Re-run failed jobs : 실패한 Job을 다시 실행
  • Re-run failed jobs : 모든 Job을 다시 실행

 

 

 

 

Workflow가  Skip 되는 경우 알아보기

다음 메세지들이 commit에 포함될 경우 Workflow 실행이 Skip된다.

  • [skip ci]
  • [ci skip]
  • [no ci]
  • [skip actions]
  • [actions skip]

 

혹은 commit에 두 줄을 띄우고 마지막 줄에 다음 문장을 추가하면 Workflow 실행이 skip된다.

  • skip-checks:true
  • skip-checks: true

 

참고자료

 

Canceling a workflow - GitHub Docs

Write access to the repository is required to perform these steps. Canceling a workflow run On GitHub.com, navigate to the main page of the repository. Under your repository name, click Actions. In the left sidebar, click the workflow you want to see. From

docs.github.com

 

Skipping workflow runs - GitHub Docs

Note: If a workflow is skipped due to path filtering, branch filtering or a commit message (see below), then checks associated with that workflow will remain in a "Pending" state. A pull request that requires those checks to be successful will be blocked f

docs.github.com

 

 

[GitHub Actions] Job Artifacts 사용해 결과 파일 다운로드 가능하게 만들기

이전 시간까지의 내용

이전 시간에서 우리는 test를 돌리는 Job과 build를 실행하는 Job을 순서대로 실행하는 방법에 대해 알아보았다.

 

Test를 실행하는 Job은 다음과 같았고,

  test:
    runs-on: ubuntu-latest
    steps:
      - name: Check out Repository
        uses: actions/checkout@v3

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

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

      - name: Test with Gradle
        run: ./gradlew test

 

Build를 하는 Job은 다음과 같았다.

  build:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - name: Check out Repository
        uses: actions/checkout@v3

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

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

      - name: Build with Gradle
        run: ./gradlew assembleRelease

 

하지만 위 빌드에는 문제가 있었다. 바로 ./gradlew assembleRelease를 하면 아래 그림과 같이 build/output 폴더에 apk 파일이 나오게 되는데 이를 확인할 방법이 없는점이다.

 

=

 

이번 시간에는 GitHub Action의 Job Artifacts 기능을 사용해 빌드한 안드로이드 파일을 저장소에 upload 하고 다운로드 가능한 상태로 만드는 방법에 대해 알아볼 것이다.

반응형

 

이 글의 저작권은 '조세영의 Kotlin World' 에 있습니다. 글, 이미지 무단 재배포 및 변경을 금지합니다.

 

 

Kotlin, Android, Spring 사용자 오픈 카톡

오셔서 궁금한 점을 질문해보세요!
비밀번호 : kotlin22

open.kakao.com