Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create workflow that has build with cache job #87

Closed
DnPlas opened this issue Dec 17, 2024 · 2 comments · Fixed by #88
Closed

Create workflow that has build with cache job #87

DnPlas opened this issue Dec 17, 2024 · 2 comments · Fixed by #88
Labels
enhancement New feature or request

Comments

@DnPlas
Copy link
Contributor

DnPlas commented Dec 17, 2024

Context

The canonical/data-platform-workflows/.github/workflows/build_charm.yaml (docs here) workflow allows charms to be independently built with charmcraft cache which:

  • Reduces build time
  • Each charm gets built in their own machine, which prevents collisions with pip
  • Uploads .charm as artefacts

Some of the team's repositories are having trouble specially because of the above. To resolve the situation, the build_charm reusable workflow can be included on_push and on_pull workflows.

What needs to get done

Create a common workflow that includes the build_charm.yaml workflow. The publish and tests jobs will depend on it.

The changes will look like this:

name: On Pull Request

# On pull_request, we:
# * always publish to charmhub at latest/edge/branchname
# * always run tests

on:
  pull_request:

jobs:

  build:
    name: Build charms
    uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v21.0.0
    strategy:
      fail-fast: false
    with:
      cache: ${{ github.event_name == 'pull_request' }}
      charmcraft-snap-channel: 3.x/edge
      path-to-charm-directory: ./charms/${{ matrix.charm }}

For repositories with multiple charms we can use the get-charm-paths action.

Definition of Done

There is a common workflow that all repositories can use for building charms with cache, charm files are downloadable, and adapts to repositories with multiple charms.

@DnPlas DnPlas added the enhancement New feature or request label Dec 17, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-6690.

This message was autogenerated

Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-6691.

This message was autogenerated

DnPlas added a commit that referenced this issue Dec 17, 2024
…ith cache

This new workflow uses the canonical/data-platform-workflows/.github/workflows/build_charm.yaml 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 build_charm.yaml
workflow is set to use charmcarft cache.

Fixes #87
DnPlas added a commit that referenced this issue Dec 17, 2024
…ith cache

This new workflow uses the canonical/data-platform-workflows/.github/workflows/build_charm.yaml 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 build_charm.yaml
workflow is set to use charmcarft cache.

Fixes #87
DnPlas added a commit that referenced this issue Dec 17, 2024
…ith 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
@DnPlas DnPlas closed this as completed in 7970ad8 Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant