Skip to content

Commit

Permalink
ci: enable workflow (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jneo8 authored Jan 4, 2024
1 parent 33d3cf8 commit 3571d67
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 4 deletions.
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

41 changes: 41 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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"
working-directory: ./src

func:
uses: canonical/bootstack-actions/.github/workflows/func.yaml@v3
needs: lint-unit
strategy:
fail-fast: false
matrix:
include:
- juju-channel: "3.1/stable"
command: "make functional"
runs-on: "['self-hosted', 'xlarge']"
with:
command: ${{ matrix.command }}
juju-channel: ${{ matrix.juju-channel }}
nested-containers: false
provider: "lxd"
python-version: "3.10"
timeout-minutes: 120
tox-version: "<4"
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 }}
25 changes: 25 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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

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
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ build: clean
@charmcraft -v pack ${BUILD_ARGS}
@bash -c ./rename.sh
@mkdir -p ${CHARM_BUILD_DIR}/${CHARM_NAME}
@unzip ${PROJECTPATH}/${CHARM_NAME}.charm -d ${CHARM_BUILD_DIR}/${CHARM_NAME}

release: clean build
@echo "Charm is built at ${CHARM_BUILD_DIR}/${CHARM_NAME}"
Expand Down
9 changes: 6 additions & 3 deletions src/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ passenv =
NO_PROXY
SNAP_HTTP_PROXY
SNAP_HTTPS_PROXY
allowlist_externals =
echo

[testenv:lint]
commands =
Expand Down Expand Up @@ -57,9 +59,10 @@ deps =

[testenv:unit]
commands =
coverage run -m unittest discover -s {toxinidir}/tests/unit -v
coverage report --omit tests/*,mod/*,.tox/*
coverage html --omit tests/*,mod/*,.tox/*
echo "No unit tests. Skipping."
# coverage run -m unittest discover -s {toxinidir}/tests/unit -v
# coverage report --omit tests/*,mod/*,.tox/*
# coverage html --omit tests/*,mod/*,.tox/*
deps = -r{toxinidir}/tests/unit/requirements.txt

[testenv:func]
Expand Down

0 comments on commit 3571d67

Please sign in to comment.