Skip to content

Commit

Permalink
Run check-lib as a part of ci.yaml CI/CD (canonical#84)
Browse files Browse the repository at this point in the history
We need to be sure our libraries are up-2-date on
the new pull-request and pushed to charmhub on
merging PR and publishing the new charm revision.

Also bump charming-action to the latest 2.2.0 while we are here.
  • Loading branch information
taurus-forever authored Jan 26, 2023
1 parent c49819a commit b67665f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,24 @@ jobs:
- name: Run tests
run: tox -e unit

lib-check:
name: Check libraries
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check libs
uses: canonical/charming-actions/check-libraries@2.2.0
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"

integration-test-microk8s-charm:
name: Integration tests for charm deployment (microk8s)
needs:
- lib-check
- lint
- unit-test
runs-on: ubuntu-latest
Expand All @@ -52,6 +67,7 @@ jobs:
integration-test-microk8s-database-relation:
name: Integration tests for database relation (microk8s)
needs:
- lib-check
- lint
- unit-test
runs-on: ubuntu-latest
Expand All @@ -70,6 +86,7 @@ jobs:
integration-test-microk8s-db-relation:
name: Integration tests for db relation (microk8s)
needs:
- lib-check
- lint
- unit-test
runs-on: ubuntu-latest
Expand All @@ -88,6 +105,7 @@ jobs:
integration-test-microk8s-db-admin-relation:
name: Integration tests for db-admin relation (microk8s)
needs:
- lib-check
- lint
- unit-test
runs-on: ubuntu-latest
Expand All @@ -106,6 +124,7 @@ jobs:
integration-test-microk8s-ha-self-healing:
name: Integration tests for high availability self healing (microk8s)
needs:
- lib-check
- lint
- unit-test
runs-on: ubuntu-latest
Expand All @@ -124,6 +143,7 @@ jobs:
integration-test-microk8s-password-rotation:
name: Integration tests for password rotation (microk8s)
needs:
- lib-check
- lint
- unit-test
runs-on: ubuntu-latest
Expand All @@ -142,6 +162,7 @@ jobs:
integration-test-microk8s-tls:
name: Integration tests for TLS (microk8s)
needs:
- lib-check
- lint
- unit-test
runs-on: ubuntu-latest
Expand Down
24 changes: 7 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,12 @@ on:
- main

jobs:
lib-check:
name: Check libraries
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check libs
uses: canonical/charming-actions/check-libraries@2.1.1
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}" # FIXME: current token will expire in 2023-07-04
github-token: "${{ secrets.GITHUB_TOKEN }}"

ci-tests:
uses: ./.github/workflows/ci.yaml

release-to-charmhub:
name: Release to CharmHub
needs:
- lib-check
- ci-tests
runs-on: ubuntu-20.04
steps:
Expand All @@ -35,10 +20,15 @@ jobs:
with:
fetch-depth: 0
- name: Select charmhub channel
uses: canonical/charming-actions/channel@2.1.1
uses: canonical/charming-actions/channel@2.2.0
id: channel
- name: Release any bumped charm libs
uses: canonical/charming-actions/release-libraries@2.2.0
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Upload charm to charmhub
uses: canonical/charming-actions/upload-charm@2.1.1
uses: canonical/charming-actions/upload-charm@2.2.0
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down

0 comments on commit b67665f

Please sign in to comment.