Skip to content

Commit

Permalink
[DPE-6265] - Fix build pipeline (#14)
Browse files Browse the repository at this point in the history
This PR adds a new plugin requirement and modifies the `tox.ini`
configuration according to the breaking changes of poetry 2.0 and
upgrades the DP workflows

Dependency and plugin updates:

*
[`pyproject.toml`](diffhunk://#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R24-R26):
Added the `poetry-plugin-export` plugin to the required plugins section.

Configuration updates:

*
[`tox.ini`](diffhunk://#diff-ef2cef9f88b4fe09ca3082140e67f5ad34fb65fb6e228f119d3812261ae51449L28-R28):
Removed the deprecated `--no-update` flag from the `poetry lock` command
[see](python-poetry/poetry#9327).
*
[`.github/workflows/ci.yaml`](diffhunk://#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddL14-R19):
Updated the `cron` syntax and changed the version of the `lint.yaml`,
`build_charm.yaml`, and `integration_test_charm.yaml` templates from
`v23.0.4` to `v24.0.6`.
[[1]](diffhunk://#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddL14-R19)
[[2]](diffhunk://#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddL59-R59)
[[3]](diffhunk://#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddL79-R79)
*
[`.github/workflows/release.yaml`](diffhunk://#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL40-R47):
Updated the version of the `build_charm.yaml` and `release_charm.yaml`
templates from `v23.0.4` to `v24.0.6`.
  • Loading branch information
skourta authored Jan 7, 2025
1 parent 3ee3949 commit db81235
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ on:
workflow_call:
pull_request:
schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
- cron: "53 0 * * *" # Daily at 00:53 UTC

jobs:
lint:
name: Lint
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v23.0.4
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v24.0.6

unit-test:
name: Unit test charm
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v23.0.4
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v24.0.6
with:
cache: true

Expand All @@ -76,11 +76,11 @@ jobs:
- lint
- unit-test
- build
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v23.0.4
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v24.0.6
with:
juju-agent-version: ${{ matrix.juju.agent }}
juju-snap-channel: ${{ matrix.juju.snap_channel }}
artifact-prefix: packed-charm-cache-true
cloud: lxd
permissions:
contents: write
contents: write
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: ./.github/workflows/ci.yaml
secrets: inherit
permissions:
contents: write # Needed for Allure Report beta
contents: write # Needed for Allure Report beta

release-libraries:
name: Release libraries
Expand All @@ -37,18 +37,18 @@ jobs:

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

release:
name: Release charm
needs:
- ci-tests
- build
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v23.0.4
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v24.0.6
with:
channel: 3.5/edge
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
secrets:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
permissions:
contents: write # Needed to create GitHub release
contents: write # Needed to create GitHub release
11 changes: 6 additions & 5 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ type: charm
# see: https://github.com/canonical/data-platform-workflows/issues/246
bases:
- build-on:
- name: ubuntu
channel: "22.04"
- name: ubuntu
channel: "22.04"
run-on:
- name: ubuntu
channel: "22.04"
- name: ubuntu
channel: "22.04"

parts:
charm:
Expand All @@ -29,9 +29,10 @@ parts:
# Convert subset of poetry.lock to requirements.txt
curl -sSL https://install.python-poetry.org | python3 -
/root/.local/bin/poetry self add poetry-plugin-export
/root/.local/bin/poetry export --only main,charm-libs --output requirements.txt
craftctl default
charm-strict-dependencies: true
charm-requirements: [requirements.txt]
charm-entrypoint: src/charm.py
charm-entrypoint: src/charm.py
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ pydantic = "^1.10, <2"
cryptography = ">=42.0.5"
jsonschema = "*"

[tool.poetry.requires-plugins]
poetry-plugin-export = ">=1.8"

[tool.poetry.group.format]
optional = true

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ description = Apply coding style standards to code
commands_pre =
poetry install --only format
commands =
poetry lock --no-update
poetry lock
poetry run ruff check --fix {[vars]all_path}
poetry run ruff format {[vars]all_path}

Expand Down

0 comments on commit db81235

Please sign in to comment.