Skip to content

Commit

Permalink
[DPE-5599][Juju 3.6] Break PR/worflow & nightly tests + DPW update (#467
Browse files Browse the repository at this point in the history
)

Updates the data platform workflow to the latest version: 22.0.0.

Breaks down the integration tests between 3.6/beta for nightly run + 3.5
for PR / merges to `2/edge` branch.

---------

Co-authored-by: Carl Csaposs <[email protected]>
  • Loading branch information
phvalguima and carlcsaposs-canonical authored Oct 7, 2024
1 parent e2a9d01 commit bec01ba
Show file tree
Hide file tree
Showing 7 changed files with 409 additions and 380 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ on:
pull_request:
schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
# Triggered on push to branch "main" by .github/workflows/release.yaml
# Triggered on push to branch "2/edge" by .github/workflows/release.yaml
workflow_call:

jobs:
lint:
name: Lint
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v21.0.1
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v22.0.0

unit-test:
name: Unit test charm
Expand Down Expand Up @@ -61,23 +61,34 @@ jobs:
path:
- .
- ./tests/integration/relations/opensearch_provider/application-charm/
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v21.0.1
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v22.0.0
with:
path-to-charm-directory: ${{ matrix.path }}
cache: true

integration-test:
name: Integration test charm | 3.5.3
strategy:
fail-fast: false
matrix:
juju:
# This runs on all runs
- agent: 3.5.3 # renovate: juju-agent-pin-minor
allure_report: true
# This runs only on scheduled runs, DPW 21 specifics (scheduled + 3.6/X)
- snap_channel: 3.6/beta
allure_report: false
name: Integration test charm | ${{ matrix.juju.agent || matrix.juju.snap_channel }}
needs:
- lint
- unit-test
- build
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v21.0.1
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v22.0.0
with:
juju-agent-version: ${{ matrix.juju.agent }}
juju-snap-channel: ${{ matrix.juju.snap_channel }}
_beta_allure_report: ${{ matrix.juju.allure_report }}
artifact-prefix: packed-charm-cache-true
cloud: lxd
juju-agent-version: 3.5.3
_beta_allure_report: true
secrets:
# GitHub appears to redact each line of a multi-line secret
# Avoid putting `{` or `}` on a line by itself so that it doesn't get redacted in logs
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Release to latest/edge
on:
push:
branches:
- main
- 2/edge

jobs:
ci-tests:
Expand Down Expand Up @@ -34,13 +34,13 @@ jobs:

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v21.0.1
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v22.0.0

release:
name: Release charm
needs:
- build
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v21.0.1
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v22.0.0
with:
channel: 2/edge
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tox -e build-dev
To run the traditional build only using `charmcraft`, run the following command:

```shell
tox -e build-production
charmcraftcache pack
```

## Developing
Expand Down
40 changes: 28 additions & 12 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,41 @@ parts:
files:
plugin: dump
source: .
build-packages:
- git
override-build: |
# Workaround to add unique identifier (git hash) to charm version while specification
# DA053 - Charm versioning
# (https://docs.google.com/document/d/1Jv1jhWLl8ejK3iJn7Q3VbCIM9GIhp8926bgXpdtx-Sg/edit?pli=1)
# is pending review.
python3 -c 'import pathlib; import shutil; import subprocess; git_hash=subprocess.run(["git", "describe", "--always", "--dirty"], capture_output=True, check=True, encoding="utf-8").stdout; file = pathlib.Path("charm_version"); shutil.copy(file, pathlib.Path("charm_version.backup")); version = file.read_text().strip(); file.write_text(f"{version}+{git_hash}")'
craftctl default
stage:
# Exclude requirements.txt file during staging
# Workaround for https://github.com/canonical/charmcraft/issues/1389 on charmcraft 2
- -requirements.txt
prime:
- charm_version
- workload_version
charm:
override-pull: |
craftctl default
if [[ ! -f requirements.txt ]]
then
echo 'ERROR: Use "tox run -e build-dev" instead of calling "charmcraft pack" directly' >&2
exit 1
fi
override-build: |
rustup default stable
craftctl default
charm-strict-dependencies: true
charm-entrypoint: src/charm.py
build-snaps:
- rustup
build-packages:
- libffi-dev
- libssl-dev
- pkg-config
override-build: |
rustup default stable
# Convert subset of poetry.lock to requirements.txt
curl -sSL https://install.python-poetry.org | python3 -
/root/.local/bin/poetry export --only main,charm-libs --output requirements.txt
craftctl default
stage:
# Exclude charm_version file during staging
- -charm_version
charm-strict-dependencies: true
charm-requirements: [requirements.txt]
charm-entrypoint: src/charm.py
Loading

0 comments on commit bec01ba

Please sign in to comment.