Skip to content

Commit

Permalink
Update to data-platform-workflows v9.0.0 (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical authored Jan 8, 2024
1 parent 792434c commit a47a1cc
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 27 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ jobs:

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v7.0.0
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v9.0.0
with:
charmcraft-snap-channel: beta
permissions:
actions: write # Needed to manage GitHub Actions cache

integration-test:
strategy:
Expand All @@ -63,7 +61,7 @@ jobs:
- lint
- unit-test
- build
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v7.0.0
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v9.0.0
with:
artifact-name: ${{ needs.build.outputs.artifact-name }}
cloud: microk8s
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ jobs:
needs:
- lib-check
uses: ./.github/workflows/ci.yaml
permissions:
actions: write # Needed to manage GitHub Actions cache

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm_without_cache.yaml@v7.0.0
uses: canonical/data-platform-workflows/.github/workflows/build_charm_without_cache.yaml@v9.0.0
with:
charmcraft-snap-channel: beta

Expand All @@ -42,7 +40,7 @@ jobs:
- lib-check
- ci-tests
- build
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v7.0.0
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v9.0.0
with:
channel: 8.0/edge
artifact-name: ${{ needs.build.outputs.artifact-name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_issue_to_jira.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
sync:
name: Sync GitHub issue to Jira
uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v7.0.0
uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v9.0.0
with:
jira-base-url: https://warthogs.atlassian.net
jira-project-key: DPE
Expand Down
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ this operator.
creates a linear Git commit history.

## Developing
Install `tox` and `poetry`
Install `tox`, `poetry`, and `charmcraftcache`

Install pipx: https://pipx.pypa.io/stable/installation/
```shell
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install tox
pipx install poetry
pipx install charmcraftcache
```

You can create an environment for development:
Expand All @@ -55,7 +56,7 @@ tox # runs 'lint' and 'unit' environments
Build the charm in this git repository using:

```shell
tox run -e build
tox run -e build-dev
```

### Deploy
Expand Down
2 changes: 1 addition & 1 deletion charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ parts:
craftctl default
if [[ ! -f requirements.txt ]]
then
echo 'ERROR: Use "tox run -e build" instead of calling "charmcraft pack" directly' >&2
echo 'ERROR: Use "tox run -e build-dev" instead of calling "charmcraft pack" directly' >&2
exit 1
fi
charm-strict-dependencies: true
Expand Down
10 changes: 5 additions & 5 deletions poetry.lock

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

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ pytest-mock = "^3.11.1"
[tool.poetry.group.integration.dependencies]
pytest = "^7.4.0"
pytest-operator = "^0.28.0"
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v7.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v7.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v9.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v9.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
juju = "^3.2.2"
mysql-connector-python = "~8.0.33"
pyyaml = "^6.0.1"
Expand Down
14 changes: 8 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ set_env =
allowlist_externals =
poetry

[testenv:{build,pack-wrapper}]
[testenv:build-{production,dev,wrapper}]
# Wrap `charmcraft pack`
pass_env =
CRAFT_SHARED_CACHE
CI
allowlist_externals =
{[testenv]allowlist_externals}
charmcraft
charmcraftcache
mv
commands_pre =
# TODO charm versioning: Remove
Expand All @@ -36,7 +37,8 @@ commands_pre =

poetry export --only main,charm-libs --output requirements.txt
commands =
build: charmcraft pack {posargs}
build-production: charmcraft pack {posargs}
build-dev: charmcraftcache pack {posargs}
commands_post =
mv requirements.txt requirements-last-build.txt
mv charm_version.backup charm_version
Expand Down Expand Up @@ -80,11 +82,11 @@ pass_env =
CI
GITHUB_OUTPUT
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
{[testenv:build-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
{[testenv:pack-wrapper]commands_pre}
{[testenv:build-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s --ignore={[vars]tests_path}/unit/ {posargs}
commands_post =
{[testenv:pack-wrapper]commands_post}
{[testenv:build-wrapper]commands_post}

0 comments on commit a47a1cc

Please sign in to comment.