Skip to content

Commit

Permalink
feat: expose ubuntu-version in build_charms_with_cache.yaml
Browse files Browse the repository at this point in the history
Expose `ubuntu-version` as an input for running the workflow on
a specific ubuntu version. This parameter is used in the runs-on
field, and can be configured by other workflows.
  • Loading branch information
DnPlas committed Jun 26, 2023
1 parent 73e1da6 commit b298d4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/build_charms_with_cache.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Workflow file: [build_charms_with_cache.yaml](build_charms_with_cache.yaml)

## Usage
See https://discourse.charmhub.io/t/faster-integration-tests-with-github-caching/8782
```yaml
jobs:
build:
name: Build charms
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@<version>
with:
# Ubuntu version that will be used for running this job
# It is used as value for "runs-on"
ubuntu-version: ubuntu-20.04
```
See https://discourse.charmhub.io/t/faster-integration-tests-with-github-caching/8782
8 changes: 6 additions & 2 deletions .github/workflows/build_charms_with_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
description: Charm packages are uploaded to this GitHub artifact name
default: charms-packed-with-cache
type: string
ubuntu-version:
description: Ubuntu version to be used by the GitHub runners
default: ubuntu-latest
type: string
outputs:
artifact-name:
description: Charm packages are uploaded to this GitHub artifact name
Expand Down Expand Up @@ -48,7 +52,7 @@ jobs:
name: Collect charms
needs:
- get-workflow-version
runs-on: ubuntu-latest
runs-on: ${{ inputs.ubuntu-version }}
timeout-minutes: 5
steps:
- name: Install pyyaml
Expand Down Expand Up @@ -77,7 +81,7 @@ jobs:
name: ${{ matrix.charm._job_display_name }}
needs:
- collect-charms
runs-on: ubuntu-latest
runs-on: ${{ inputs.ubuntu-version }}
timeout-minutes: 60
steps:
- name: Checkout
Expand Down

0 comments on commit b298d4d

Please sign in to comment.