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

ci: remove wrapper around get charm paths and build with cache workflows #651

Merged
Merged
12 changes: 10 additions & 2 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ on:
secrets:
CHARMCRAFT_CREDENTIALS:
required: true
inputs:
artifact-prefix:
description: |
Prefix for charm package GitHub artifact(s)

Use canonical/data-platform-workflows build_charm.yaml to build the charm(s)
mvlassis marked this conversation as resolved.
Show resolved Hide resolved
required: true
type: string
NohaIhab marked this conversation as resolved.
Show resolved Hide resolved

jobs:
lib-check:
Expand Down Expand Up @@ -126,7 +134,7 @@ jobs:
timeout-minutes: 5
uses: actions/download-artifact@v4
with:
pattern: packed-charm-cache-true-.-charms-${{ matrix.charm }}-*
pattern: ${{ inputs.artifact-prefix }}-*
merge-multiple: true

- name: Integration tests
Expand All @@ -137,7 +145,7 @@ jobs:
# Pass the path where the charm artefact is downloaded to the tox command
# FIXME: Right now the complete path is half hardcoded to <charm name>_ubuntu-20.04-amd64.charm
# We need to find a better way to dynamically get this value
sg snap_microk8s -c "tox -e ${{ matrix.charm }}-integration -- --model kubeflow --charm-path=${{ github.workspace }}/charms/${{ matrix.charm }}/${{ matrix.charm }}_ubuntu-20.04-amd64.charm"
sg snap_microk8s -c "tox -e ${{ matrix.charm }}-integration -- --model kubeflow --charm-path=${{ github.workspace }}/charms/${{ matrix.charm }}/${{ matrix.charm }}_ubuntu@20.04-amd64.charm"

- name: Collect charm debug artifacts
uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main
Expand Down
33 changes: 28 additions & 5 deletions .github/workflows/on_pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,42 @@ on:
pull_request:

jobs:
get-paths-and-build:
name: Get charm paths and build with cache
uses: canonical/charmed-kubeflow-workflows/.github/workflows/get_charms_build_with_cache.yaml@main
get-charm-paths:
name: Generate the Charm Matrix content
runs-on: ubuntu-latest
mvlassis marked this conversation as resolved.
Show resolved Hide resolved
outputs:
charm_paths: ${{ steps.get-charm-paths.outputs.charm-paths }}
NohaIhab marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
mvlassis marked this conversation as resolved.
Show resolved Hide resolved
- 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
NohaIhab marked this conversation as resolved.
Show resolved Hide resolved
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
needs: get-charm-paths
strategy:
matrix:
charm: ${{ fromJson(needs.get-charm-paths.outputs.charm_paths) }}
NohaIhab marked this conversation as resolved.
Show resolved Hide resolved
with:
# Update to 3.x/stable once the latest/candidate is released to that track
charmcraft-snap-channel: latest/candidate
NohaIhab marked this conversation as resolved.
Show resolved Hide resolved
path-to-charm-directory: ${{ matrix.charm }}

tests:
name: Run Tests
needs: [get-paths-and-build]
needs: build
NohaIhab marked this conversation as resolved.
Show resolved Hide resolved
uses: ./.github/workflows/integrate.yaml
secrets: inherit
with:
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}

# publish runs in parallel with tests, as we always publish in this situation
publish-charm:
name: Publish Charm
needs: [get-paths-and-build]
needs: build
uses: ./.github/workflows/publish.yaml
secrets: inherit
Loading