Skip to content

Commit 1608d5a

Browse files
authored
[DPE-7513] Basic github ci pipeline for charm (#5)
* Basic github ci pipeline for charm * [DPE-7513] Basic github ci pipeline for charm * [DPE-7513] Remove chache when building * [DPE-7513] Remove chache when building * [DPE-7513] Remove chache when building * [DPE-7513] Remove chache when building * [DPE-7513] Remove chache when building * [DPE-7513] Remove chache when building * [DPE-7513] Remove chache when building * [DPE-7513] Remove chache when building * [DPE-7513] Remove chache when building * [DPE-7513] Remove chache when building * [DPE-7513] Add spread tests
1 parent 08d218b commit 1608d5a

File tree

8 files changed

+633
-0
lines changed

8 files changed

+633
-0
lines changed

.github/.jira_sync_config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Sync GitHub issues to Jira issues
2+
3+
# Configuration syntax:
4+
# https://github.com/canonical/gh-jira-sync-bot/blob/main/README.md#client-side-configuration
5+
settings:
6+
# Repository specific settings
7+
components: # Jira components that will be added to Jira issue
8+
- cassandra-vm
9+
10+
# Settings shared across Data Platform repositories
11+
label_mapping:
12+
# If the GitHub issue does not have a label in this mapping, the Jira issue will be created as a Bug
13+
enhancement: Story
14+
jira_project_key: DPE # https://warthogs.atlassian.net/browse/DPE
15+
status_mapping:
16+
opened: untriaged
17+
closed: done # GitHub issue closed as completed
18+
not_planned: rejected # GitHub issue closed as not planned
19+
add_gh_comment: true
20+
sync_description: false
21+
sync_comments: false

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug report
3+
about: File a bug report
4+
labels: bug
5+
6+
---
7+
8+
<!-- Thank you for submitting a bug report! All fields are required unless marked optional. -->
9+
10+
## Steps to reproduce
11+
<!-- Please enable debug logging by running `juju model-config logging-config="<root>=INFO;unit=DEBUG"` (if possible) -->
12+
1.
13+
14+
## Expected behavior
15+
16+
17+
## Actual behavior
18+
<!-- If applicable, add screenshots -->
19+
20+
21+
## Versions
22+
23+
<!-- Run `lsb_release -sd` -->
24+
Operating system:
25+
26+
<!-- Run `juju version` -->
27+
Juju CLI:
28+
29+
<!-- Model version from `juju status` -->
30+
Juju agent:
31+
32+
<!-- App revision from `juju status` or (advanced) commit hash -->
33+
Charm revision:
34+
35+
## Log output
36+
<!-- Please enable debug logging by running `juju model-config logging-config="<root>=INFO;unit=DEBUG"` (if possible) -->
37+
<!-- Then, run `juju debug-log --replay > log.txt` and upload "log.txt" file here -->
38+
Juju debug log:
39+
40+
<!-- (Optional) Copy the logs that are relevant to the bug & paste inside triple backticks below -->
41+
42+
43+
## Additional context
44+
<!-- (Optional) Add any additional information here -->

.github/workflows/ci.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright 2024 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
4+
name: Tests
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
on:
11+
workflow_call:
12+
outputs:
13+
artifact-prefix:
14+
description: build_charm.yaml `artifact-prefix` output
15+
value: ${{ jobs.build.outputs.artifact-prefix }}
16+
pull_request:
17+
paths-ignore:
18+
- 'docs/**'
19+
- '**.md'
20+
schedule:
21+
- cron: '53 0 * * *' # Daily at 00:53 UTC
22+
23+
jobs:
24+
lint:
25+
name: Lint
26+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
27+
28+
unit-test:
29+
name: Unit test charm
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 5
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
- name: Install tox & poetry
36+
run: |
37+
pipx install tox
38+
pipx install poetry
39+
- name: Run tests
40+
run: tox run -e unit
41+
- name: Upload Coverage to Codecov
42+
uses: codecov/codecov-action@v4
43+
44+
lib-check:
45+
if: ${{ github.event_name == 'schedule' }}
46+
name: Check libraries
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 5
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0
54+
- name: Check libs
55+
uses: canonical/charming-actions/[email protected]
56+
with:
57+
credentials: ${{ secrets.CHARMHUB_TOKEN }}
58+
github-token: ${{ secrets.GITHUB_TOKEN }}
59+
permissions:
60+
pull-requests: write
61+
62+
build:
63+
strategy:
64+
fail-fast: true
65+
matrix:
66+
path:
67+
- .
68+
name: Build charm
69+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
70+
with:
71+
path-to-charm-directory: ${{ matrix.path }}
72+
cache: false
73+
74+
integration-test:
75+
name: Integration test charm
76+
needs:
77+
- lint
78+
- unit-test
79+
- build
80+
uses: ./.github/workflows/integration_test.yaml
81+
with:
82+
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
83+
permissions:
84+
contents: write # Needed for Allure Report

0 commit comments

Comments
 (0)