Skip to content

Commit

Permalink
ci: separate snap build and PR publish jobs
Browse files Browse the repository at this point in the history
This allows running snap tests while the store is still processing the
snap to publish to a branch.
  • Loading branch information
lengau committed Dec 16, 2024
1 parent 7615a1c commit 686d7a0
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,24 @@ jobs:
snap: ${{ steps.snapcraft.outputs.snap }}
release: edge/${{ steps.vars.outputs.branch }}

# Commented out until we can provide the necessary launchpad credentials.
# snap-remote-build:
# runs-on: ubuntu-latest
# steps:
# - name: Start installing snapcraft
# run: echo SNAP_JOB=$(sudo snap install --classic --no-wait snapcraft) >> $GITHUB_OUTPUT
# id: install
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Remote-build snap
# id: snapcraft
# run: |
# sudo snap watch ${{ steps.install.outputs.SNAP_JOB }}
# snapcraft remote-build --launchpad-accept-public-upload
# - name: Upload snap artifacts
# uses: actions/upload-artifact@v4
# with:
# name: snap
# path: ./*.snap
snap-publish:
needs: [snap-build]
runs-on: self-hosted
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Download snap artifact
uses: actions/download-artifact@v4
with:
name: snap
path: snap-artifacts
- name: Publish feature branch to edge/pr-${{ github.event.number }}
if: secrets.SNAPCRAFT_STORE_CREDENTIALS != ''
uses: canonical/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
snap: "*.snap"
release: edge/pr-${{ github.event.number }}

snap-tests:
needs: [snap-build]
Expand Down

0 comments on commit 686d7a0

Please sign in to comment.