Skip to content

Commit

Permalink
Update data-platform-workflows to v9.0.0 (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical authored Jan 8, 2024
1 parent 64494b6 commit 9913ac7
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 33 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
lint:
name: Lint
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v7.0.0
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v9.0.0

unit-test:
name: Unit test charm
Expand All @@ -43,6 +43,9 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
# Workaround for https://github.com/canonical/charmcraft/issues/1389#issuecomment-1880921728
touch requirements.txt
- name: Check libs
uses: canonical/charming-actions/check-libraries@2.3.0
with:
Expand All @@ -53,11 +56,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-revision: 1349 # version 2.3.0
permissions:
actions: write # Needed to manage GitHub Actions cache
charmcraft-snap-channel: beta

integration-test:
strategy:
Expand All @@ -72,7 +73,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: lxd
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
name: Tests
uses: ./.github/workflows/ci.yaml
secrets: inherit
permissions:
actions: write # Needed to manage GitHub Actions cache

release-libraries:
name: Release libraries
Expand All @@ -26,6 +24,9 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
# Workaround for https://github.com/canonical/charmcraft/issues/1389#issuecomment-1880921728
touch requirements.txt
- name: Release charm libraries
uses: canonical/charming-actions/release-libraries@2.3.0
with:
Expand All @@ -34,16 +35,16 @@ jobs:

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-revision: 1349 # version 2.3.0
charmcraft-snap-channel: beta

release:
name: Release charm
needs:
- 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 @@ -20,12 +20,13 @@ this operator.
the `main` branch. This also avoids merge commits and 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 @@ -49,7 +50,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
3 changes: 2 additions & 1 deletion charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ 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
build-packages:
- libffi-dev
- libssl-dev
Expand Down
14 changes: 7 additions & 7 deletions poetry.lock

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

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ parameterized = "^0.9.0"

[tool.poetry.group.integration.dependencies]
pytest = "^7.4.0"
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v7.0.0", subdirectory = "python/pytest_plugins/github_secrets"}
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v9.0.0", subdirectory = "python/pytest_plugins/github_secrets"}
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"
tenacity = "^8.2.2"
Expand Down
14 changes: 8 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ 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 =
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

Expand Down Expand Up @@ -83,11 +85,11 @@ pass_env =
GITHUB_OUTPUT
SECRETS_FROM_GITHUB
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 9913ac7

Please sign in to comment.