Skip to content

Commit

Permalink
[DPE-6252] fix: build on application charm (#526)
Browse files Browse the repository at this point in the history
Follow up of
canonical/charmcraft#2055 (comment)

Also update CI to enable charmcraft 3 migration.
  • Loading branch information
zmraul authored Jan 9, 2025
1 parent f7b6bb1 commit fc51448
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 43 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

unit-test:
name: Unit test charm
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Checkout
Expand All @@ -33,7 +33,7 @@ jobs:
run: tox run -e unit

promtool:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -52,7 +52,7 @@ jobs:
terraform-test:
name: Terraform - Lint and Simple Deployment
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 120
steps:
- name: Checkout repo
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
lib-check:
name: Check libraries
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout
Expand All @@ -136,11 +136,10 @@ jobs:
path:
- .
- ./tests/integration/relations/opensearch_provider/application-charm/
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@beta-charmcraftst124
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v24.0.6
with:
path-to-charm-directory: ${{ matrix.path }}
cache: false
# charmcraft-snap-revision: 5303

integration-test:
strategy:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ jobs:

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@beta-charmcraftst124
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v24.0.6

release:
name: Release charm
needs:
- build
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@beta-charmcraftst124
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v24.0.6
with:
channel: 2/edge
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
Expand Down
9 changes: 0 additions & 9 deletions charmcraft-24.04.patch

This file was deleted.

18 changes: 12 additions & 6 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@
# See LICENSE file for licensing details.

type: charm
# base: ubuntu@22.04
# platforms:
# amd64:
# Use upcoming ST124 syntax
# To pack this charm, a temporary compatibility wrapper https://github.com/canonical/charmcraftst124
# is required until ST124 support is added to charmcraft
# (ST124 syntax is needed to enable multi-base charms with Ubuntu 24.04. We use ST124 syntax across
# all of our charms [even those that aren't multi base] for consistency and to simplify CI/CD
# maintenance & tooling)
platforms:
ubuntu@22.04:amd64:
ubuntu@24.04:amd64:
# platforms:
# ubuntu@22.04:amd64:
# # TODO: enable after charmcraft 3 migration
# ubuntu@24.04:amd64:
bases:
- build-on:
- name: "ubuntu"
channel: "22.04"
run-on:
- name: "ubuntu"
channel: "22.04"

parts:
files:
plugin: dump
Expand Down
11 changes: 3 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ pytest = "^8.2.2"
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v24.0.6", subdirectory = "python/pytest_plugins/github_secrets"}
pytest-asyncio = "^0.21.2"
pytest-operator = "^0.35.0"
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", branch = "beta-charmcraftst124", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v24.0.6", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v24.0.6", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
pytest-microceph = {git = "https://github.com/canonical/data-platform-workflows", tag = "v24.0.6", subdirectory = "python/pytest_plugins/microceph"}
# should not be updated unless https://github.com/juju/python-libjuju/issues/1093 is fixed
# websockets issue solved from 3.2.5.1 https://github.com/juju/python-libjuju/issues/1184 # TODO: restore to 3.5.0
juju = "==3.6.0"
ops = "^2.15"
tenacity = "^8.4.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
# See LICENSE file for licensing details.

type: charm
platforms:
ubuntu@22.04:amd64:
# bases:
# - build-on:
# - name: "ubuntu"
# channel: "22.04"
# run-on:
# - name: "ubuntu"
# channel: "22.04"
# platforms:
# ubuntu@22.04:amd64:
bases:
- build-on:
- name: "ubuntu"
channel: "22.04"
run-on:
- name: "ubuntu"
channel: "22.04"

parts:
my-charm:
source: .
plugin: charm

0 comments on commit fc51448

Please sign in to comment.