diff --git a/.github/workflows/auto-update-libs-k8s-worker.yaml b/.github/workflows/auto-update-libs-k8s-worker.yaml index a1c8e634..22fdc573 100644 --- a/.github/workflows/auto-update-libs-k8s-worker.yaml +++ b/.github/workflows/auto-update-libs-k8s-worker.yaml @@ -5,8 +5,18 @@ on: - cron: "0 1 * * *" jobs: + charmcraft-channel: + runs-on: ubuntu-24.04 + outputs: + channel: ${{ steps.charmcraft.outputs.channel }} + steps: + - uses: actions/checkout@v4 + - id: charmcraft + run: echo "channel=$(cat .charmcraft-channel)" >> $GITHUB_OUTPUT auto-update-libs: - uses: canonical/operator-workflows/.github/workflows/auto_update_charm_libs.yaml@08c5a65a0bc4696164b4f85a29a9ccbd830d10d8 + needs: [charmcraft-channel] + uses: canonical/operator-workflows/.github/workflows/auto_update_charm_libs.yaml@main secrets: inherit with: working-directory: ./charms/worker/k8s + charmcraft-channel: ${{ needs.charmcraft-channel.outputs.channel }} diff --git a/.github/workflows/bot_pr_approval.yaml b/.github/workflows/bot_pr_approval.yaml new file mode 100644 index 00000000..e38c5841 --- /dev/null +++ b/.github/workflows/bot_pr_approval.yaml @@ -0,0 +1,9 @@ +name: Provide approval for bot PRs + +on: + pull_request: + +jobs: + bot_pr_approval: + uses: canonical/operator-workflows/.github/workflows/bot_pr_approval.yaml@main + secrets: inherit diff --git a/.github/workflows/charm-analysis.yaml b/.github/workflows/charm-analysis.yaml index e4b8f0fa..b064a784 100644 --- a/.github/workflows/charm-analysis.yaml +++ b/.github/workflows/charm-analysis.yaml @@ -6,7 +6,7 @@ on: jobs: unit-tests: - uses: canonical/operator-workflows/.github/workflows/test.yaml@08c5a65a0bc4696164b4f85a29a9ccbd830d10d8 + uses: canonical/operator-workflows/.github/workflows/test.yaml@main secrets: inherit with: charm-directory: charms diff --git a/.github/workflows/comment.yaml b/.github/workflows/comment.yaml index eb8379ce..a2b1768f 100644 --- a/.github/workflows/comment.yaml +++ b/.github/workflows/comment.yaml @@ -2,11 +2,11 @@ name: Comment on the pull request on: workflow_run: - workflows: ["Tests"] + workflows: ["Charm Analysis"] types: - completed jobs: comment-on-pr: - uses: canonical/operator-workflows/.github/workflows/comment.yaml@08c5a65a0bc4696164b4f85a29a9ccbd830d10d8 + uses: canonical/operator-workflows/.github/workflows/comment.yaml@main secrets: inherit diff --git a/.github/workflows/comment_contributing.yaml b/.github/workflows/comment_contributing.yaml new file mode 100644 index 00000000..e3fa6a34 --- /dev/null +++ b/.github/workflows/comment_contributing.yaml @@ -0,0 +1,13 @@ +name: Comment on the pull request + +on: + pull_request: + types: + - opened + branches: + - 'track/**' + +jobs: + comment-on-pr: + uses: canonical/operator-workflows/.github/workflows/comment_contributing.yaml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/download-charm.yaml b/.github/workflows/download-charm.yaml new file mode 100644 index 00000000..8d246e31 --- /dev/null +++ b/.github/workflows/download-charm.yaml @@ -0,0 +1,55 @@ +# Copyright 2024 Canonical Ltd. +# See LICENSE file for licensing details. + +name: Download Charm + +on: + workflow_call: + inputs: + charm-arch: + type: string + description: The charm architecture to download + default: amd64 + charm-base: + type: string + description: The charm base to download + default: ubuntu@20.04 + charm-channel: + type: string + description: The charm channel to download + default: latest/edge + charm-name: + type: string + description: The charm name to download + juju-channel: + type: string + description: Which juju client to use for pulling charms + default: 3/stable + runs-on: + type: string + description: Image runner for building the images + default: ubuntu@22.04 + +jobs: + download-charms: + name: Download Charms + runs-on: ${{ inputs.runs-on }} + env: + CHARM_FILE: "${{ inputs.charm-name }}-${{ inputs.charm-channel }}-${{ inputs.charm-base }}-${{ inputs.charm-arch }}.charm" + steps: + - name: Install Juju + run: | + sudo snap install juju --channel ${{ inputs.juju-channel }} + - name: Download charm + run: | + CHARM_FILE=${{ env.CHARM_FILE }} + CHARM_FILE=${CHARM_FILE//\//-} # replace all slashes with dashes + echo CHARM_FILE=${CHARM_FILE} >> $GITHUB_ENV # update GitHub ENV vars + juju download ${{ inputs.charm-name }} --channel ${{ inputs.charm-channel }} --base ${{ inputs.charm-base }} --arch ${{ inputs.charm-arch }} - > ${{ env.CHARM_FILE }} + - name: Upload charm artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.charm-name }}-charm + path: ${{ env.CHARM_FILE }} + if-no-files-found: error + \ No newline at end of file diff --git a/.github/workflows/load_test.yaml b/.github/workflows/load_test.yaml index 792599fb..ea18f097 100644 --- a/.github/workflows/load_test.yaml +++ b/.github/workflows/load_test.yaml @@ -9,7 +9,7 @@ jobs: uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@08c5a65a0bc4696164b4f85a29a9ccbd830d10d8 with: provider: lxd - juju-channel: 3.3/stable + juju-channel: 3/stable load-test-enabled: true load-test-run-args: "-e LOAD_TEST_HOST=localhost" secrets: inherit diff --git a/.github/workflows/promote-charms.yaml b/.github/workflows/promote-charms.yaml index ddac359f..a06101ac 100644 --- a/.github/workflows/promote-charms.yaml +++ b/.github/workflows/promote-charms.yaml @@ -67,7 +67,7 @@ jobs: strategy: matrix: charm-directory: ${{ fromJson(needs.select-charms.outputs.charms) }} - uses: canonical/operator-workflows/.github/workflows/promote_charm.yaml@08c5a65a0bc4696164b4f85a29a9ccbd830d10d8 + uses: canonical/operator-workflows/.github/workflows/promote_charm.yaml@main with: origin-channel: ${{needs.configure-track.outputs.track}}/${{ github.event.inputs.origin-risk }} destination-channel: ${{needs.configure-track.outputs.track}}/${{ github.event.inputs.destination-risk }}