Skip to content

Commit

Permalink
Support charmcraft 3 (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
chanchiwai-ray authored Feb 27, 2025
1 parent 14d0e16 commit db7add7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
with:
provider: "lxd"
juju-channel: ${{ matrix.juju-channel }}
charmcraft-channel: "2.x/stable"
charmcraft-channel: "3.x/stable"

- name: Enabled nested LXD containers
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
credentials: ${{ secrets.CHARMHUB_TOKEN }}
destination-channel: ${{ steps.set-channels.outputs.destination-channel }}
origin-channel: ${{ steps.set-channels.outputs.origin-channel }}
charmcraft-channel: "2.x/stable"
charmcraft-channel: "3.x/stable"
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Pack and upload to charmhub
uses: canonical/charming-actions/upload-charm@2.6.2
with:
charmcraft-channel: "2.x/stable"
charmcraft-channel: "3.x/stable"
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
# Ensure the charm is built in an isolated environment and on the correct base in an lxd container.
Expand Down
23 changes: 9 additions & 14 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
type: charm
bases:
- build-on:
- name: ubuntu
channel: "22.04"
architectures: ["amd64"]
run-on:
- name: ubuntu
channel: "22.04"
architectures:
- amd64
- name: ubuntu
channel: "20.04"
architectures:
- amd64

parts:
charm:
plugin: charm
source: .

platforms:
ubuntu@20.04:amd64:
ubuntu@22.04:amd64:
3 changes: 2 additions & 1 deletion tests/functional/test_charm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os

import pytest

Expand All @@ -9,7 +10,7 @@
@pytest.mark.skip_if_deployed
async def test_build_and_deploy(ops_test, series):
"""Build simple-stream charm and deploy it in bundle."""
simple_stream_charm = await ops_test.build_charm(".")
simple_stream_charm = os.environ.get(f"CHARM_PATH_{series.upper()}")

await ops_test.model.deploy(
ops_test.render_bundle(
Expand Down

0 comments on commit db7add7

Please sign in to comment.