Skip to content

feat: charmcraft actions #4

feat: charmcraft actions

feat: charmcraft actions #4

Workflow file for this run

name: Test Charmcraft
on:
pull_request:
paths:
- ".github/workflows/*charmcraft*"
- "charmcraft**"
push:
branches:
- main
jobs:
test-charmcraft-pack-action:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
channel: [latest/stable, latest/edge, 2.x/stable]
include:
- os: ubuntu-24.04
channel: ''
revision: 5303
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: juju/juju
path: juju
- name: Pack charm
id: charmcraft
uses: ./charmcraft-pack
with:
path: juju/testcharms/charms/ubuntu-plus/
channel: ${{ matrix.channel }}
revision: ${{ matrix.revision }}
- name: Assert revision number
if: matrix.revision != ''
run: |
set -ex
installed_rev="$(snap info charmcraft | tail -1 | awk '{print $(NF-2)}')"
[ "$installed_rev" == "(${{ matrix.revision }})" ]
- name: Upload charm
uses: actions/upload-artifact@v4
with:
name: test-charm_${{ matrix.os }}
path: ${{ steps.charmcraft.outputs.charms }}