Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical committed Dec 18, 2024
1 parent 1dccd79 commit 42f5383
Show file tree
Hide file tree
Showing 3 changed files with 988 additions and 724 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,31 @@ jobs:

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v23.1.0
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@charmcraftst124
with:
charmcraft-snap-channel: 3.x/edge
# Use of cache blocked by https://github.com/canonical/charmcraft/issues/1456
# Details: https://github.com/canonical/charmcraftcache/issues/3
cache: false
# Remove prefix when cache enabled
# Needed to avoid conflict with artifact name on release CI
artifact-prefix: ci-packed-charm-cache-false-.

release:
name: Release charm
needs:
- build
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@charmcraftst124
with:
channel: dpe/edge/test-cc-poetry-plugin
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
create-github-release: false
charmcraft-snap-channel: 3.x/edge
secrets:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}

gh-hosted-collect-integration-tests:
name: (GH hosted) Collect integration test groups
needs:
- lint
- unit-test
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -134,8 +145,6 @@ jobs:
ubuntu-versions: {series: focal}
name: ${{ matrix.juju-snap-channel }} - (GH hosted) ${{ matrix.groups.job_name }} | ${{ matrix.ubuntu-versions.series }}
needs:
- lint
- unit-test
- build
- gh-hosted-collect-integration-tests
runs-on: ubuntu-latest
Expand Down
30 changes: 24 additions & 6 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ platforms:
[email protected]:amd64:
[email protected]:amd64:
[email protected]:arm64:
# Files implicitly created by charmcraft without a part:
# - dispatch (https://github.com/canonical/charmcraft/pull/1898)
# - manifest.yaml
# (https://github.com/canonical/charmcraft/blob/9ff19c328e23b50cc06f04e8a5ad4835740badf4/charmcraft/services/package.py#L259)
# Files implicitly copied/"primed" by charmcraft without a part:
# - actions.yaml, config.yaml, metadata.yaml
# (https://github.com/canonical/charmcraft/blob/9ff19c328e23b50cc06f04e8a5ad4835740badf4/charmcraft/services/package.py#L290-L293
# https://github.com/canonical/charmcraft/blob/9ff19c328e23b50cc06f04e8a5ad4835740badf4/charmcraft/services/package.py#L156-L157)
parts:
# "poetry-deps" part name is a magic constant
# https://github.com/canonical/craft-parts/pull/901
Expand All @@ -20,16 +28,23 @@ parts:
build-packages:
- curl
override-build: |
python3 -m pip install --upgrade pip==24.3.1
curl -sSL https://install.python-poetry.org | python3 - --version 1.8.4
ln -sf $HOME/.local/bin/poetry /usr/local/bin/poetry
foo:
python3 -m pip install --upgrade pip==24.3.1 # renovate: charmcraft-pip-latest
curl -sSL https://install.python-poetry.org | python3 - --version 1.8.4 # renovate: charmcraft-poetry-latest
ln -sf "$HOME/.local/bin/poetry" /usr/local/bin/poetry
# "charm-poetry" part name is arbitrary; use for consistency
# Avoid using "charm" part name since that has special meaning to charmcraft
charm-poetry:
# By default, the `poetry` plugin creates/primes these directories:
# - lib, src
# (https://github.com/canonical/charmcraft/blob/9ff19c328e23b50cc06f04e8a5ad4835740badf4/charmcraft/parts/plugins/_poetry.py#L76-L78)
# - venv
# (https://github.com/canonical/charmcraft/blob/9ff19c328e23b50cc06f04e8a5ad4835740badf4/charmcraft/parts/plugins/_poetry.py#L95
# https://github.com/canonical/craft-parts/blob/afb0d652eb330b6aaad4f40fbd6e5357d358de47/craft_parts/plugins/base.py#L270)
plugin: poetry
source: .
after:
- poetry-deps
poetry-with:
- charm-libs
poetry-export-extra-args: ['--only', 'main,charm-libs']
build-snaps:
- rustup
build-packages:
Expand All @@ -39,6 +54,9 @@ parts:
override-build: |
rustup default stable
craftctl default
# Include requirements.txt in *.charm artifact for easier debugging
cp requirements.txt "$CRAFT_PART_INSTALL/requirements.txt"
# "files" part name is arbitrary; use for consistency
files:
plugin: dump
source: .
Expand Down
Loading

0 comments on commit 42f5383

Please sign in to comment.