From b6705243e09e9b121440ed7d3c90d4fd274b8e65 Mon Sep 17 00:00:00 2001 From: sudeephb Date: Thu, 7 Dec 2023 15:11:20 +0545 Subject: [PATCH 1/4] Add github actions for tests and release --- .github/CODEOWNERS | 12 ++++++++++++ .github/workflows/issues_to_jira.yaml | 25 +++++++++++++++++++++++++ .github/workflows/pr.yaml | 23 +++++++++++++++++++++++ .github/workflows/release.yaml | 21 +++++++++++++++++++++ .github/workflows/sonar.yaml | 17 +++++++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/issues_to_jira.yaml create mode 100644 .github/workflows/pr.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/sonar.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..206a197 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,12 @@ +# This is a template `CODEOWNERS` file for ops charms +# This file is managed by bootstack-charms-spec and should not be modified +# within individual charm repos. https://launchpad.net/bootstack-charms-spec + +# For more information about CODEOWNER, please refer to +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file + +# These owners will be the default owners for everything in the repo. Unless a +# later match takes precedence, @canonical/bootstack will be requested for +# review when someone opens a pull request. +* @canonical/bootstack-reviewers + diff --git a/.github/workflows/issues_to_jira.yaml b/.github/workflows/issues_to_jira.yaml new file mode 100644 index 0000000..cc44534 --- /dev/null +++ b/.github/workflows/issues_to_jira.yaml @@ -0,0 +1,25 @@ +# This is a template `issues_to_jira.yaml` file for ops charms +# This file is managed by bootstack-charms-spec and should not be modified +# within individual charm repos. https://launchpad.net/bootstack-charms-spec + +# This workflow requires to provide JIRA webhook URL via JIRA_URL GitHub Secret. +# +# Read more: +# https://support.atlassian.com/cloud-automation/docs/jira-automation-triggers/#Automationtriggers-Incomingwebhook +# +# Original code source: +# https://github.com/beliaev-maksim/github-to-jira-automation + +name: Issues to JIRA + +on: + issues: + # available via github.event.action + types: [opened, reopened, closed] + +jobs: + update: + name: Update Issue + uses: beliaev-maksim/github-to-jira-automation/.github/workflows/issues_to_jira.yaml@master + secrets: + JIRA_URL: ${{ secrets.JIRA_URL }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..d60adec --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,23 @@ +# This is a template `pr.yaml` file for ops charms +# This file is managed by bootstack-charms-spec and should not be modified +# within individual charm repos. https://launchpad.net/bootstack-charms-spec + +name: PR workflow running lint checkers, unit and functional tests + +on: + pull_request: + types: [ opened, synchronize, reopened ] + branches: [ master, main ] + paths-ignore: + - '**.md' + - '**.rst' + +jobs: + pr: + uses: canonical/bootstack-actions/.github/workflows/pull-request.yaml@main + secrets: inherit + with: + python-version-unit: "['3.8', '3.10']" + python-version-func: "3.10" + tox-version: "<4" + commands: "['make functional']" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..89f3336 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,21 @@ +# This is a template `release.yaml` file for ops charms +# This file is managed by bootstack-charms-spec and should not be modified +# within individual charm repos. https://launchpad.net/bootstack-charms-spec + +name: Release to Edge + +on: + push: + branches: [ master, main ] + +jobs: + release: + uses: canonical/bootstack-actions/.github/workflows/charm-release.yaml@main + secrets: inherit + with: + python-version-unit: "['3.8', '3.10']" + python-version-func: "3.10" + tox-version: "<4" + channel: "latest/edge" + upload-image: false + commands: "['make functional']" diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml new file mode 100644 index 0000000..df30d49 --- /dev/null +++ b/.github/workflows/sonar.yaml @@ -0,0 +1,17 @@ +# This is a template `sonar.yaml` file for ops charms +# This file is managed by bootstack-charms-spec and should not be modified +# within individual charm repos. https://launchpad.net/bootstack-charms-spec + +name: SonarCloud +on: + workflow_run: + workflows: + - PR workflow running lint checkers, unit and functional tests + types: [completed] + +jobs: + sonar: + uses: canonical/bootstack-actions/.github/workflows/sonar.yaml@main + secrets: inherit + with: + workflow-name: PR workflow running lint checkers, unit and functional tests From 7db48330bab58505d50204371f58e8797d7192cb Mon Sep 17 00:00:00 2001 From: sudeephb Date: Fri, 8 Dec 2023 10:13:54 +0545 Subject: [PATCH 2/4] Update CODEOWNERS to reflect name changes of the team --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 206a197..ef9d84a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,5 +8,5 @@ # These owners will be the default owners for everything in the repo. Unless a # later match takes precedence, @canonical/bootstack will be requested for # review when someone opens a pull request. -* @canonical/bootstack-reviewers +* @canonical/soleng-reviewers From f0ad8ac5fb1fd60fe60457cdf00f54fbf5a4f174 Mon Sep 17 00:00:00 2001 From: jneo8 Date: Thu, 14 Dec 2023 10:27:25 +0800 Subject: [PATCH 3/4] ci: Use bootstack-actions v2 in pr.yaml --- .github/workflows/pr.yaml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d60adec..bf1b898 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -13,11 +13,26 @@ on: - '**.rst' jobs: - pr: - uses: canonical/bootstack-actions/.github/workflows/pull-request.yaml@main - secrets: inherit + lint-unit: + uses: canonical/bootstack-actions/.github/workflows/lint-unit.yaml@v2 + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.10"] with: - python-version-unit: "['3.8', '3.10']" - python-version-func: "3.10" + python-version: ${{ matrix.python-version }} + tox-version: "<4" + + func: + uses: canonical/bootstack-actions/.github/workflows/func.yaml@v2 + needs: lint-unit + strategy: + fail-fast: false + with: + command: "make functional" + juju-channel: "3.1/stable" + nested-containers: false + provider: "lxd" + python-version: "3.10" + timeout-minutes: 120 tox-version: "<4" - commands: "['make functional']" From a5e02a4a784769f63611a413924974f6c8364dbb Mon Sep 17 00:00:00 2001 From: jneo8 Date: Thu, 14 Dec 2023 11:57:09 +0800 Subject: [PATCH 4/4] ci: Use microstack provider for test and update release workflow --- .github/workflows/pr.yaml | 2 +- .github/workflows/release.yaml | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index bf1b898..7522392 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -32,7 +32,7 @@ jobs: command: "make functional" juju-channel: "3.1/stable" nested-containers: false - provider: "lxd" + provider: "microstack" python-version: "3.10" timeout-minutes: 120 tox-version: "<4" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 89f3336..4fa59b4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,14 +8,17 @@ on: push: branches: [ master, main ] +concurrency: + group: release + cancel-in-progress: true + jobs: + check: + uses: ./.github/workflows/check.yaml release: - uses: canonical/bootstack-actions/.github/workflows/charm-release.yaml@main + needs: check + uses: canonical/bootstack-actions/.github/workflows/charm-release.yaml@v2 secrets: inherit with: - python-version-unit: "['3.8', '3.10']" - python-version-func: "3.10" - tox-version: "<4" channel: "latest/edge" upload-image: false - commands: "['make functional']"