diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index d1a8b17c..45150eb5 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -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) + required: true + type: string jobs: lib-check: @@ -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 @@ -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 _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 diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index 9bcc2213..59102ae5 100644 --- a/.github/workflows/on_pull_request.yaml +++ b/.github/workflows/on_pull_request.yaml @@ -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 + 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: + strategy: + matrix: + charm: ${{ fromJSON(needs.get-charm-paths.outputs.charm-paths) }} + name: Build charm | ${{ matrix.charm }} + needs: + - get-charm-paths + uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v29.0.0 + with: + charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release + path-to-charm-directory: ${{ matrix.charm }} tests: name: Run Tests - needs: [get-paths-and-build] + needs: build 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 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9284c033..e591d822 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -48,7 +48,7 @@ jobs: strategy: fail-fast: false matrix: - charm-path: ${{ fromJson(needs.get-charm-paths.outputs.charm_paths_list) }} + charm-path: ${{ fromJSON(needs.get-charm-paths.outputs.charm_paths_list) }} steps: - name: Checkout