Skip to content

Commit

Permalink
[DPE-5612] Update shared workflows version (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
Batalex authored Oct 23, 2024
1 parent 61a42d7 commit 97b255b
Show file tree
Hide file tree
Showing 7 changed files with 586 additions and 501 deletions.
46 changes: 26 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,32 @@ concurrency:
on:
pull_request:
schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
- cron: "53 0 * * *" # Daily at 00:53 UTC
# Triggered on push to branch "main" by .github/workflows/release.yaml
workflow_call:

jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install tox
# TODO: Consider replacing with custom image on self-hosted runner OR pinning version
run: python3 -m pip install tox
run: pipx install tox
- name: Run linters
run: tox run -e lint

unit-test:
name: Unit tests
runs-on: ubuntu-22.04
timeout-minutes: 5
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install tox
# TODO: Consider replacing with custom image on self-hosted runner OR pinning version
run: python3 -m pip install tox
run: pipx install tox
- name: Run tests
run: tox run -e unit

Expand All @@ -45,12 +43,20 @@ jobs:
uses: ./.github/workflows/sync_docs.yaml
secrets: inherit
permissions:
contents: write # Needed to update tags
contents: write # Needed to update tags
pull-requests: write # Need to create PR

build:
name: Build charms
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v7
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
cache: true
path-to-charm-directory: ${{ matrix.path }}
strategy:
matrix:
path:
- .
- tests/integration/app-charm

integration-test:
strategy:
Expand All @@ -74,18 +80,18 @@ jobs:
timeout-minutes: 240
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup operator environment
# TODO: Replace with custom image on self-hosted runner
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.4/stable
bootstrap-options: "--agent-version 3.4.2"
- name: Download packed charm(s)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact-name }}
pattern: packed-charm-cache-true-*
merge-multiple: true
- name: Select tests
id: select-tests
run: |
Expand Down Expand Up @@ -118,18 +124,18 @@ jobs:
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup operator environment
# TODO: Replace with custom image on self-hosted runner
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.4/stable
bootstrap-options: "--agent-version 3.4.2"
- name: Download packed charm(s)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact-name }}
pattern: packed-charm-cache-true-*
merge-multiple: true
- name: Select tests
id: select-tests
run: |
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ on:
jobs:
lib-check:
name: Check libraries
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check libs
Expand All @@ -29,25 +29,27 @@ jobs:
uses: ./.github/workflows/ci.yaml
secrets: inherit
permissions:
contents: write # Needed to login to Discourse
contents: write # Needed to login to Discourse
pull-requests: write # Need to create PR
actions: write

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm_without_cache.yaml@v7
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
cache: false

release:
name: Release to Charmhub
needs:
- lib-check
- ci-tests
- build
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v7
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v22.0.0
with:
channel: 3/edge
artifact-name: ${{ needs.build.outputs.artifact-name }}
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
secrets:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
permissions:
contents: write # Needed to create GitHub release
contents: write # Needed to create GitHub release
Loading

0 comments on commit 97b255b

Please sign in to comment.