Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPE-5599][Juju 3.6] Break PR/worflow & nightly tests + DPW update #467

Merged
merged 29 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
73be5ca
[DPE-5599][Juju 3.6] Break PR/worflow & nightly tests + DPW update
phvalguima Oct 2, 2024
7ac64dc
Rename ci.yaml to workflow.yaml
phvalguima Oct 2, 2024
b756e9b
Move away from agent to snap channel versions
phvalguima Oct 2, 2024
6d5789b
Create nightly.yaml
phvalguima Oct 2, 2024
944ebce
Update release.yaml
phvalguima Oct 2, 2024
8c3e68c
Update nightly.yaml
phvalguima Oct 2, 2024
3ab2bda
Update release.yaml
phvalguima Oct 2, 2024
115df1c
Update workflow.yaml
phvalguima Oct 2, 2024
1aba2af
Update CONTRIBUTING.md
phvalguima Oct 2, 2024
b1c0a8f
Update charmcraft.yaml
phvalguima Oct 2, 2024
3273889
Update charmcraft.yaml
phvalguima Oct 2, 2024
038794c
Update and rename workflow.yaml to ci.yaml
phvalguima Oct 2, 2024
88491f2
Delete .github/workflows/nightly.yaml
phvalguima Oct 2, 2024
f44d252
Update release.yaml
phvalguima Oct 2, 2024
057b694
Move to 3.5.4 as we want the latest stable juju
phvalguima Oct 3, 2024
4c1fe43
Update ci.yaml
phvalguima Oct 3, 2024
cb9151f
Update ci.yaml
phvalguima Oct 3, 2024
1c131cb
Update ci.yaml
phvalguima Oct 3, 2024
b42c024
Update ci.yaml
phvalguima Oct 3, 2024
5aff704
Update ci.yaml
phvalguima Oct 3, 2024
5dee779
Update ci.yaml
phvalguima Oct 3, 2024
8a85ec2
Update pyproject.toml
phvalguima Oct 3, 2024
b80eb56
Update charmcraft.yaml
phvalguima Oct 3, 2024
2d660ec
Update tox.ini
phvalguima Oct 3, 2024
55c45ed
Update tox.ini
phvalguima Oct 3, 2024
7f764ef
Update tox ini to use external poetry
phvalguima Oct 3, 2024
fac6591
Fix poetry.lock
phvalguima Oct 3, 2024
1bfde76
Update project toml
phvalguima Oct 7, 2024
932fd4f
Update release.yaml
phvalguima Oct 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 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,33 @@ 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.4 # 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-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
23 changes: 3 additions & 20 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 All @@ -15,32 +15,15 @@ jobs:
permissions:
contents: write # Needed for Allure Report beta

# release-libraries:
phvalguima marked this conversation as resolved.
Show resolved Hide resolved
# name: Release libraries
# needs:
# - ci-tests
# runs-on: ubuntu-latest
# timeout-minutes: 60
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Release charm libraries
# uses: canonical/charming-actions/[email protected]
# with:
# credentials: ${{ secrets.CHARMHUB_TOKEN }}
# github-token: ${{ secrets.GITHUB_TOKEN }}

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
39 changes: 27 additions & 12 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,40 @@ 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
phvalguima marked this conversation as resolved.
Show resolved Hide resolved
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