From a0f7f1347fa11fd44076badc31ab04d8c436768b Mon Sep 17 00:00:00 2001 From: Ashley James Date: Thu, 11 Jan 2024 11:04:27 +0530 Subject: [PATCH] ci: Rework GitHub workflow files (#35) --- .github/workflows/check.yaml | 38 ++++++++++++++++++++++++++++++++++ .github/workflows/pr.yaml | 24 --------------------- .github/workflows/release.yaml | 25 ++++++++++++++++++++++ 3 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/check.yaml delete mode 100644 .github/workflows/pr.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 0000000..3ef4039 --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,38 @@ +name: Check workflow running lint checkers, unit and functional tests + +on: + 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@v2 + needs: lint-unit + strategy: + fail-fast: false + matrix: + include: + - command: "FUNC_ARGS='--series focal' make functional" + - command: "FUNC_ARGS='--series jammy' make functional" + with: + command: ${{ matrix.command }} + juju-channel: "3.1/stable" + nested-containers: false + provider: "lxd" + python-version: "3.10" + timeout-minutes: 120 + tox-version: "<4" diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml deleted file mode 100644 index 39ddbd5..0000000 --- a/.github/workflows/pr.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# 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" - juju-channel: "3.1/stable" - commands: "['FUNC_ARGS=\"--series focal\" make functional', 'FUNC_ARGS=\"--series jammy\" make functional']" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..309562b --- /dev/null +++ b/.github/workflows/release.yaml @@ -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