Skip to content

Run bundle tests and publish to Charmhub #12

Run bundle tests and publish to Charmhub

Run bundle tests and publish to Charmhub #12

name: Run bundle tests and publish to Charmhub
on:
workflow_call:
inputs:
release:
description: Bundle release to run tests on and publish to Charmhub
type: string
required: true
secrets:
CHARMCRAFT_CREDENTIALS:
required: true
workflow_dispatch:
inputs:
release:
description: Bundle release to run tests on and publish to Charmhub
type: string
required: true
secrets:
CHARMCRAFT_CREDENTIALS:
required: true
jobs:
get-release-inputs:
name: Get required inputs
runs-on: ubuntu-22.04
outputs:
bundle_path: ${{ steps.bundle-path.outputs.bundle_path }}
bundle_test_path: ${{ steps.bundle-test-path.outputs.bundle_test_path }}
steps:
- uses: actions/checkout@v3
- name: Get bundle path for ${{ inputs.release }}
id: bundle-path
run: python scripts/get_bundle_path.py ${{ inputs.release }}
- name: Get bundle test path for ${{ inputs.release }}
id: bundle-test-path
run: python scripts/get_bundle_test_path.py ${{ inputs.release }}
# Commenting out since currently the tests are failing because of
# https://github.com/canonical/oidc-gatekeeper-operator/issues/112
#run-tests:
#name: Run tests
#needs: [get-release-inputs]
#uses: ./.github/workflows/full-bundle-tests.yaml
#with:
#bundle-test-path: ${{ needs.get-release-inputs.outputs.bundle_test_path }}
#bundle-source: --file ${{ needs.get-release-inputs.outputs.bundle_path }}/bundle.yaml
publish-bundle-for-releases-affected:
name: Publish bundle
runs-on: ubuntu-22.04
# we'll need to add back `run-tests` in the `needs` part, once we bring it back
needs: [get-release-inputs]
steps:
- uses: actions/checkout@v3
- name: Publish bundle release ${{ inputs.release }}
uses: mvlassis/charming-actions/upload-bundle@main
with:
credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }}
github-token: ${{ secrets.GITHUB_TOKEN }}
bundle-path: ${{ needs.get-release-inputs.outputs.bundle_path }}
channel: ${{ inputs.release }}