Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 2 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
name: Tests
name: Pull request

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -12,14 +12,6 @@ on:
- '**.md'
- '.github/renovate.json5'
- 'docs/**'
schedule:
- 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:
Expand Down Expand Up @@ -76,7 +68,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/[email protected]

integration-test:
name: Integration test charm
name: Integration tests
needs:
- lint
- unit-test
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
name: Integration tests

on:
workflow_call:
inputs:
Expand Down Expand Up @@ -31,17 +35,20 @@ jobs:

spread_jobs = (
subprocess.run(
["charmcraft", "test", "--list", "github-ci"], capture_output=True, check=True, text=True
["charmcraft", "test", "--list", "github-ci:tests/spread/integration/"],
capture_output=True,
check=True,
text=True,
)
.stdout.strip()
.split("\n")
)
jobs = []
for job in spread_jobs:
# Example `job`: "github-ci:ubuntu-24.04:tests/spread/test_charm.py:juju36"
# Example `job`: "github-ci:ubuntu-24.04:tests/spread/integration/test_charm.py:juju36"
_, runner, task, variant = job.split(":")
# Example: "test_charm.py"
task = task.removeprefix("tests/spread/")
task = task.removeprefix("tests/spread/integration/")
if runner.endswith("-arm"):
architecture = "arm64"
else:
Expand All @@ -62,7 +69,7 @@ jobs:
file.write(output)
- name: Generate Allure default test results
if: ${{ github.event_name == 'schedule' && github.run_attempt == '1' }}
run: tox run -e integration -- tests/integration --allure-default-dir=allure-default-results
run: tox run -e integration -- tests/integration/integration --allure-default-dir=allure-default-results
- name: Upload Allure default results
# Default test results in case the integration tests time out or runner set up fails
# (So that Allure report will show "unknown"/"failed" test result, instead of omitting the test)
Expand Down
40 changes: 34 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,46 @@
paths-ignore:
- 'docs/**'
- '.github/renovate.json5'
- '.github/workflows/automatic-doc-checks.yml'
- '.github/workflows/ci.yaml'
- '.github/workflows/check_libs.yaml'
- '.github/workflows/check_pr.yaml'
- '.github/workflows/schedule.yaml'
- '.github/workflows/tiobe_scan.yaml'

jobs:
ci-tests:
name: Tests
uses: ./.github/workflows/ci.yaml
build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/[email protected]

integration-tests:
name: Integration tests
needs:
- build
uses: ./.github/workflows/integration_test.yaml
with:
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
secrets: inherit
permissions:
contents: write # Needed for Allure Report

release-tests:
name: Release tests
needs:
- build
uses: ./.github/workflows/release_test.yaml
with:
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
secrets: inherit
permissions:
contents: write # Needed for Allure Report

release-libraries:
name: Release libraries
needs:
- ci-tests
- build
- integration-tests
- release-tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
Expand All @@ -42,11 +68,13 @@
release:
name: Release charm
needs:
- ci-tests
- build
- integration-tests
- release-tests
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
track: '8.0'
artifact-prefix: ${{ needs.ci-tests.outputs.artifact-prefix }}
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
secrets:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
permissions:
Expand Down
Loading
Loading