Skip to content

Commit ba1e705

Browse files
Use single (cached) build for tests & release (#379)
Use the same build for integration tests & release, so that we release what we tested Use charmcraftcache for the build Signed by Mykola & Jon: https://docs.google.com/document/d/1Wt0ds4dEcih4cvHWkbvvALtqonC_D9crcNQteX34SUg/edit
1 parent 42d953c commit ba1e705

File tree

4 files changed

+24
-28
lines changed

4 files changed

+24
-28
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ concurrency:
99
on:
1010
pull_request:
1111
schedule:
12-
- cron: "53 0 * * *" # Daily at 00:53 UTC
12+
- cron: '53 0 * * *' # Daily at 00:53 UTC
1313
# Triggered on push to branch "main" by .github/workflows/release.yaml
1414
workflow_call:
15+
outputs:
16+
artifact-prefix:
17+
description: build_charm.yaml `artifact-prefix` output
18+
value: ${{ jobs.build.outputs.artifact-prefix }}
1519

1620
jobs:
1721
lint:
1822
name: Lint
19-
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v26.0.0
23+
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v29.0.0
2024

2125
lib-check:
2226
name: Check libraries
@@ -55,15 +59,14 @@ jobs:
5559

5660
build:
5761
name: Build charm | ${{ matrix.path }}
58-
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v26.0.0
62+
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v29.0.0
5963
strategy:
6064
matrix:
6165
path:
6266
- .
6367
- tests/integration/ha_tests/application_charm
6468
- tests/integration/relation_tests/application-charm
6569
with:
66-
cache: true
6770
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
6871
path-to-charm-directory: ${{ matrix.path }}
6972

@@ -73,9 +76,9 @@ jobs:
7376
- lint
7477
- unit-test
7578
- build
76-
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v26.0.0
79+
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v29.0.0
7780
with:
78-
artifact-prefix: packed-charm-cache-true
81+
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
7982
cloud: microk8s
8083
microk8s-snap-channel: 1.29-strict/stable # renovate: latest microk8s
8184
juju-agent-version: 3.6.1 # renovate: juju-agent-pin-minor

.github/workflows/release.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,15 @@ jobs:
3434
permissions:
3535
contents: write # Needed for Allure Report beta
3636

37-
build:
38-
name: Build charm
39-
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
40-
with:
41-
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
42-
4337
release:
4438
name: Release charm
4539
needs:
4640
- ci-tests
47-
- build
48-
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
41+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
4942
with:
5043
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
5144
channel: 6/edge
52-
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
45+
artifact-prefix: ${{ needs.ci-tests.outputs.artifact-prefix }}
5346
secrets:
5447
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
5548
permissions:

poetry.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ pytest = "^8.1.1"
7474
pytest-asyncio = "^0.21.1"
7575
pytest-mock = "^3.14.0"
7676
pytest-operator = "^0.36.0"
77-
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v26.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
78-
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v26.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
79-
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v26.0.0", subdirectory = "python/pytest_plugins/github_secrets"}
80-
allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v26.0.0", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"}
77+
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v29.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
78+
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v29.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
79+
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v29.0.0", subdirectory = "python/pytest_plugins/github_secrets"}
80+
allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v29.0.0", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"}
8181

8282
[build-system]
8383
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)