Skip to content

Commit

Permalink
breaking: Show craft logs instead of uploading to artifact
Browse files Browse the repository at this point in the history
Print snapcraft/rockcraft/charmcraft logs to GitHub Actions log instead of uploading log file to artifact
  • Loading branch information
carlcsaposs-canonical committed Jan 15, 2025
1 parent 92d0a9f commit b17aee8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 35 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/build_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,9 @@ jobs:
env:
# Used by charmcraftcache (to avoid GitHub API rate limit)
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload charmcraft logs
if: ${{ failure() && steps.pack.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: logs-charmcraft-build-${{ needs.collect-platforms.outputs.artifact-prefix-with-inputs }}-platform-${{ matrix.platform.name_in_artifact }}
path: ~/.local/state/charmcraft/log/
if-no-files-found: error
- name: Charmcraft logs
if: ${{ success() || (failure() && steps.pack.outcome == 'failure') }}
run: cat ~/.local/state/charmcraft/log/*
- run: touch .empty
- name: Upload charm package
uses: actions/upload-artifact@v4
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/build_rock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,9 @@ jobs:
id: pack
working-directory: ${{ inputs.path-to-rock-directory }}
run: sudo --user "$USER" --preserve-env --preserve-env=PATH -- env -- rockcraft pack -v --platform='${{ matrix.platform.name }}'
- name: Upload rockcraft logs
if: ${{ failure() && steps.pack.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: logs-rockcraft-build-${{ inputs.artifact-prefix }}-platform-${{ matrix.platform.name }}
path: ~/.local/state/rockcraft/log/
if-no-files-found: error
- name: Rockcraft logs
if: ${{ success() || (failure() && steps.pack.outcome == 'failure') }}
run: cat ~/.local/state/rockcraft/log/*
- run: touch .empty
- name: Upload rock package
uses: actions/upload-artifact@v4
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/build_snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,9 @@ jobs:
id: pack
working-directory: ${{ inputs.path-to-snap-project-directory }}
run: sudo --user "$USER" --preserve-env --preserve-env=PATH -- env -- snapcraft pack -v --build-for='${{ matrix.platform.name }}'
- name: Upload snapcraft logs
if: ${{ failure() && steps.pack.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: logs-snapcraft-build-${{ inputs.artifact-prefix }}-platform-${{ matrix.platform.name }}
path: ~/.local/state/snapcraft/log/
if-no-files-found: error
- name: Snapcraft logs
if: ${{ success() || (failure() && steps.pack.outcome == 'failure') }}
run: cat ~/.local/state/snapcraft/log/*
- run: touch .empty
- name: Upload snap package
uses: actions/upload-artifact@v4
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/release_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ jobs:
env:
CHARMCRAFT_AUTH: ${{ secrets.charmhub-token }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload charmcraft logs
if: ${{ failure() && steps.release.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: logs-charmcraft-release-${{ inputs.artifact-prefix }}
path: ~/.local/state/charmcraft/log/
if-no-files-found: ignore
- name: Charmcraft logs
if: ${{ success() || (failure() && steps.release.outcome == 'failure') }}
run: cat ~/.local/state/charmcraft/log/*
10 changes: 3 additions & 7 deletions .github/workflows/release_snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ jobs:
SNAPCRAFT_STORE_AUTH: candid
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snap-store-token }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload snapcraft logs
if: ${{ failure() && steps.release.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: logs-snapcraft-release-${{ inputs.artifact-prefix }}
path: ~/.local/state/snapcraft/log/
if-no-files-found: ignore
- name: Snapcraft logs
if: ${{ success() || (failure() && steps.release.outcome == 'failure') }}
run: cat ~/.local/state/snapcraft/log/*

0 comments on commit b17aee8

Please sign in to comment.