-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'carlcsaposs-canonical/one-build' into K…
…F-6756-refactor-ci-on-push-release-publish
- Loading branch information
Showing
8 changed files
with
138 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
# reusable workflow triggered by other actions | ||
name: CI | ||
name: Tests | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
schedule: | ||
- cron: '0 8 * * TUE' | ||
# Triggered on push by .github/workflows/release.yaml | ||
workflow_call: | ||
secrets: | ||
CHARMCRAFT_CREDENTIALS: | ||
required: true | ||
inputs: | ||
outputs: | ||
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 | ||
description: build_charm.yaml `artifact-prefix` output | ||
value: ${{ jobs.build.outputs.artifact-prefix }} | ||
charm-paths: | ||
value: ${{ jobs.get-charm-paths.outputs.charm-paths }} | ||
channel: | ||
value: ${{ jobs.get-charm-paths.outputs.channel }} | ||
|
||
jobs: | ||
lib-check: | ||
|
@@ -94,9 +98,58 @@ jobs: | |
# So the model's name must be kubeflow | ||
# See: https://github.com/kubeflow/kubeflow/issues/6136 | ||
model: kubeflow | ||
|
||
|
||
get-charm-paths: | ||
name: Generate the Charm Matrix content | ||
runs-on: ubuntu-latest | ||
outputs: | ||
charm-paths: ${{ steps.get-charm-paths.outputs.charm-paths }} | ||
channel: ${{ steps.select-channel.outputs.name }} | ||
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 | ||
- name: Select charmhub channel | ||
uses: canonical/charming-actions/[email protected] | ||
id: select-channel | ||
|
||
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/[email protected] | ||
with: | ||
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release | ||
path-to-charm-directory: ${{ matrix.charm }} | ||
|
||
release: | ||
strategy: | ||
matrix: | ||
charm: ${{ fromJSON(needs.get-charm-paths.outputs.charm-paths) }} | ||
name: Release charm to Charmhub branch | ${{ matrix.charm }} | ||
if: ${{ github.event_name == 'pull_request' }} | ||
needs: | ||
- build | ||
uses: canonical/data-platform-workflows/.github/workflows/[email protected] | ||
with: | ||
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release | ||
channel: ${{ needs.get-charm-paths.outputs.channel }} | ||
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} | ||
path-to-charm-directory: ${{ matrix.charm }} | ||
create-git-tags: false | ||
secrets: | ||
charmhub-token: ${{ secrets.CHARMCRAFT_CREDENTIALS }} | ||
|
||
integration: | ||
name: Integration tests (microk8s) | ||
needs: | ||
- build | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
|
@@ -137,13 +190,21 @@ jobs: | |
pattern: ${{ inputs.artifact-prefix }}-* | ||
merge-multiple: true | ||
|
||
- name: Download packed charm(s) | ||
id: download-charms | ||
timeout-minutes: 5 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: ${{ needs.build.outputs.artifact-prefix }}-* | ||
merge-multiple: true | ||
|
||
- name: Integration tests | ||
run: | | ||
# Requires the model to be called kubeflow due to | ||
# https://github.com/canonical/kfp-operators/issues/389 | ||
juju add-model kubeflow | ||
# 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 | ||
# 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 }}[email protected]" | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# reusable workflow triggered manually | ||
name: Promote charm to other tracks and channels | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
destination-channel: | ||
description: 'Destination Channel' | ||
required: true | ||
origin-channel: | ||
description: 'Origin Channel' | ||
required: true | ||
charm-name: | ||
description: 'Charm subdirectory name' | ||
required: true | ||
|
||
jobs: | ||
promote-charm: | ||
name: Promote charm | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Release charm to channel | ||
# TODO: use canonical/charming-actions/promote-charm? | ||
uses: canonical/charming-actions/[email protected] | ||
with: | ||
credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
destination-channel: ${{ github.event.inputs.destination-channel }} | ||
origin-channel: ${{ github.event.inputs.origin-channel }} | ||
tag-prefix: ${{ github.event.inputs.charm-name }} | ||
charm-path: charms/${{ github.event.inputs.charm-name}} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.