C.W.K.
Stream
Lesson 06 of 13 · published

Artifact

~10 min · artifacts, upload, download

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

단일 workflow run 을 살아남는 파일

Artifact 는 한 job 이 업로드하고 다른 job (같은 workflow run 안) 또는 run UI 에서 90 일 동안 다운로드 가능한 파일/디렉토리야. 다른 runner 에서 도는 job 간 데이터 전달 방법이야.

흔한 용도:

  • Test report (JUnit XML, coverage HTML).
  • Build 출력 (dist/, tar 로 저장된 container image).
  • End-to-end test 스크린샷.
  • 실패 시 log 와 디버그 번들.

두 action

  • actions/upload-artifact@v4 — job 끝에 업로드.
  • actions/download-artifact@v4 — 다른 job 시작에 다운로드 (같은 run 만).

v4 는 v3 보다 훨씬 빠름 (다른 저장 backend) 그리고 naming 규칙 변경: run 안 artifact 이름은 unique 해야 함. Matrix 있으면 이름에 matrix 차원 포함.

Code

Upload + matrix-aware naming + download·yaml
jobs:
  test:
    strategy:
      matrix:
        python: ['3.10', '3.11', '3.12']
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: pytest --junitxml=report.xml
      - if: always()
        uses: actions/upload-artifact@v4
        with:
          # name unique per matrix cell
          name: pytest-report-py${{ matrix.python }}
          path: report.xml
          retention-days: 14

  publish-report:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v4
        with:
          # download every artifact whose name starts with pytest-report-
          pattern: pytest-report-*
          merge-multiple: true
      - run: ls -lah

External links

Exercise

테스트 도는 workflow 골라. JUnit XML 이나 coverage HTML 을 if: always() 와 함께 artifact 로 업로드. 실패한 run 에서 다운로드 가능한지 확인.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.