Skip to content

Commit

Permalink
Update many of the operator-workflow-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Oct 25, 2024
1 parent 01301e2 commit 0ea46b8
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 6 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/auto-update-libs-k8s-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
9 changes: 9 additions & 0 deletions .github/workflows/bot_pr_approval.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/charm-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 13 additions & 0 deletions .github/workflows/comment_contributing.yaml
Original file line number Diff line number Diff line change
@@ -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
55 changes: 55 additions & 0 deletions .github/workflows/download-charm.yaml
Original file line number Diff line number Diff line change
@@ -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: [email protected]
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: [email protected]

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

2 changes: 1 addition & 1 deletion .github/workflows/load_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/promote-charms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 0ea46b8

Please sign in to comment.