From bf97f794fc3de4eeb4ac56bbe2efc9156c4a2524 Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Fri, 17 Jan 2025 10:36:41 +0000 Subject: [PATCH] Use single (cached) build for tests & release (#61) 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 --- .github/workflows/ci.yaml | 15 +++++++++------ .github/workflows/release.yaml | 11 ++--------- poetry.lock | 18 +++++++++--------- pyproject.toml | 8 ++++---- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5a1941f3..1441a917 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,14 +9,18 @@ concurrency: on: pull_request: schedule: - - cron: "53 0 * * *" # Daily at 00:53 UTC + - cron: '53 0 * * *' # Daily at 00:53 UTC # Triggered on push to branch "main" by .github/workflows/release.yaml workflow_call: + outputs: + artifact-prefix: + description: build_charm.yaml `artifact-prefix` output + value: ${{ jobs.build.outputs.artifact-prefix }} jobs: lint: name: Lint - uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v26.0.0 + uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v29.0.0 lib-check: name: Check libraries @@ -57,14 +61,13 @@ jobs: build: name: Build charm | ${{ matrix.path }} - uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v26.0.0 + uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v29.0.0 strategy: matrix: path: - . - tests/integration/application with: - cache: true charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release path-to-charm-directory: ${{ matrix.path }} @@ -74,9 +77,9 @@ jobs: - lint - unit-test - build - uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v26.0.0 + uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v29.0.0 with: - artifact-prefix: packed-charm-cache-true + artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} cloud: microk8s microk8s-snap-channel: 1.29-strict/stable # renovate: latest microk8s juju-agent-version: 3.6.1 # renovate: juju-agent-pin-minor diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bb74aa44..a2975c07 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,22 +12,15 @@ jobs: permissions: contents: write # Needed for Allure Report beta - build: - name: Build charm - uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v26.0.0 - with: - charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release - release-charm: name: Release charm needs: - ci-tests - - build - uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v26.0.0 + uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v29.0.0 with: charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release channel: 6/edge - artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} + artifact-prefix: ${{ needs.ci-tests.outputs.artifact-prefix }} secrets: charmhub-token: ${{ secrets.CHARMHUB_TOKEN }} permissions: diff --git a/poetry.lock b/poetry.lock index eb808768..097404cd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -33,8 +33,8 @@ pytest = "*" [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v26.0.0" -resolved_reference = "92d0a9f28a22c57b5965866c22f65b5021d3b115" +reference = "v29.0.0" +resolved_reference = "90077c956fd22995aec4c1e5b86cf6248717d8c7" subdirectory = "python/pytest_plugins/allure_pytest_collection_report" [[package]] @@ -1623,8 +1623,8 @@ develop = false [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v26.0.0" -resolved_reference = "92d0a9f28a22c57b5965866c22f65b5021d3b115" +reference = "v29.0.0" +resolved_reference = "90077c956fd22995aec4c1e5b86cf6248717d8c7" subdirectory = "python/pytest_plugins/github_secrets" [[package]] @@ -1681,8 +1681,8 @@ pyyaml = "*" [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v26.0.0" -resolved_reference = "92d0a9f28a22c57b5965866c22f65b5021d3b115" +reference = "v29.0.0" +resolved_reference = "90077c956fd22995aec4c1e5b86cf6248717d8c7" subdirectory = "python/pytest_plugins/pytest_operator_cache" [[package]] @@ -1701,8 +1701,8 @@ pytest = "*" [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v26.0.0" -resolved_reference = "92d0a9f28a22c57b5965866c22f65b5021d3b115" +reference = "v29.0.0" +resolved_reference = "90077c956fd22995aec4c1e5b86cf6248717d8c7" subdirectory = "python/pytest_plugins/pytest_operator_groups" [[package]] @@ -2294,4 +2294,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = "^3.10" -content-hash = "0ee79622dbbba2a4428011721fc178d917d7f3992735605b1d24db1c54d20767" +content-hash = "531f90917f5e555d0e5ccb24b803fd355f144f966a2a448035793229b35753c2" diff --git a/pyproject.toml b/pyproject.toml index b16b7164..fed57b18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,10 +63,10 @@ juju = "^3.5.0" pytest = "^8.1.1" pytest-mock = "^3.14.0" pytest-operator = "^0.34.0" -pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v26.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"} -pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v26.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"} -pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v26.0.0", subdirectory = "python/pytest_plugins/github_secrets"} -allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v26.0.0", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"} +pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v29.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"} +pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v29.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"} +pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v29.0.0", subdirectory = "python/pytest_plugins/github_secrets"} +allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v29.0.0", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"} # Linting tools configuration