Skip to content

Commit

Permalink
ci: create a new workflow for getting charm paths and building them w…
Browse files Browse the repository at this point in the history
…ith cache (#88)

* ci: create a new workflow for getting charm paths and building them with cache

This new workflow uses the  as the central piece for building charms in dedicated machines and uploading them as artefacts. This is beneficial because it will allow the CI of pull requests to use charm artefacts in different operations,
such as testing and publishing, this change also helps reducing the build time as the
workflow is set to use charmcarft cache.

Fixes #87
  • Loading branch information
DnPlas authored Dec 19, 2024
1 parent c158e94 commit 7970ad8
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/get_charms_build_with_cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build charms with cache

on:
workflow_call:

jobs:

get-charm-paths:
name: Generate the Charm Matrix content
runs-on: ubuntu-latest
outputs:
charm_paths: ${{ steps.get-charm-paths.outputs.charm-paths }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get paths for all charms in this repo
id: get-charm-paths
uses: canonical/kubeflow-ci/actions/get-charm-paths@main

build:
name: Build charms
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v21.0.0
needs: get-charm-paths
strategy:
fail-fast: false
matrix:
charm: ${{ fromJson(needs.get-charm-paths.outputs.charm_paths) }}
with:
cache: true
charmcraft-snap-channel: 3.x/stable
path-to-charm-directory: ./${{ matrix.charm }}

0 comments on commit 7970ad8

Please sign in to comment.