Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
ci: enable github workflow (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jneo8 authored Jan 26, 2024
1 parent 5950538 commit 783a0cc
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -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/soleng-reviewers

44 changes: 44 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check workflow running linter, unit and functional tests

on:
workflow_call:
pull_request:
types: [opened, synchronize, reopened]
branches: [master, main]
paths-ignore:
- "**.md"
- "**.rst"

jobs:
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: ${{ matrix.python-version }}
tox-version: "<4"

func:
uses: canonical/bootstack-actions/.github/workflows/func.yaml@v3
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"
runs-on: "['self-hosted', 'runner-k8s-svc-check']"
action-operator: false
external-controller: true
juju-controller: soleng-ci-ctrl
zaza-yaml: "LS0tCm1vZGVsX3NldHRpbmdzOgogIGltYWdlLXN0cmVhbTogcmVsZWFzZWQKcmVnaW9uOiBwcm9kc3RhY2s2CmNsb3VkOiBidWlsZGVyLWNsb3VkCmNyZWRlbnRpYWw6IGJ1aWxkZXItY2xvdWQtY3JlZAo="
secrets:
juju-controllers-yaml: ${{ secrets.JUJU_CONTROLLERS_YAML }}
juju-accounts-yaml: ${{ secrets.JUJU_ACCOUNTS_YAML }}
openstack-auth-env: ${{ secrets.OPENSTACK_AUTH_ENV }}
25 changes: 25 additions & 0 deletions .github/workflows/issues_to_jira.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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]

concurrency:
group: release
cancel-in-progress: true

jobs:
check:
uses: ./.github/workflows/check.yaml
secrets: inherit

release:
needs: check
uses: canonical/bootstack-actions/.github/workflows/charm-release.yaml@v2
secrets: inherit
with:
channel: "latest/edge"
upload-image: false
17 changes: 17 additions & 0 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ submodules-update:
@git submodule update --init --recursive --remote --merge

build: clean submodules-update
sudo apt install -y unzip
@echo "Building charm to base directory ${CHARM_BUILD_DIR}/${CHARM_NAME}"
@-git rev-parse --abbrev-ref HEAD > ./repo-info
@-git describe --always > ./version
Expand All @@ -52,6 +53,7 @@ build: clean submodules-update
@mkdir -p ${CHARM_BUILD_DIR}/${CHARM_NAME}
@unzip ${PROJECTPATH}/${CHARM_NAME}.charm -d ${CHARM_BUILD_DIR}/${CHARM_NAME}


release: clean build unpack
@echo "Charm is built at ${CHARM_BUILD_DIR}/${CHARM_NAME}"

Expand Down
1 change: 1 addition & 0 deletions tests/functional/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
python-openstackclient
git+https://github.com/openstack-charmers/[email protected]#egg=zaza

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ commands =
flake8
black --check --exclude "/(\.eggs|\.git|\.tox|\.venv|\.build|dist|charmhelpers|mod)/" .
deps =
black
black<24.0.0 # Remove once we make our linter pass on it
flake8<6.0.0 # https://github.com/PyCQA/flake8-import-order/issues/189
flake8-docstrings
flake8-import-order
Expand Down

0 comments on commit 783a0cc

Please sign in to comment.