Skip to content

Commit

Permalink
allow action to start dev env
Browse files Browse the repository at this point in the history
  • Loading branch information
kian99 committed Aug 22, 2024
1 parent 775677b commit 195794f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
5 changes: 1 addition & 4 deletions .github/actions/test-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,4 @@ Use the action by adding the following to a Github workflow:
Note that it's recommended to pin the action version to the same version as `jimm-version` to ensure the action works as expected for that specific version of JIMM.

The action accepts the following inputs:
- `jimm-version`: The version of JIMM you want to test against.
- `juju-channel`: The snap channel to use when installing and bootstrapping Juju.
- `ghcr-pat`: A PAT token with package:read access that has access to the `canonical/jimm` repo.
For full details on the inputs see `action.yaml`.
16 changes: 13 additions & 3 deletions .github/actions/test-server/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ description: "Create a JIMM environment"

inputs:
jimm-version:
description: 'JIMM version tag to use. This will decide the version of JIMM to start e.g. v3.1.7'
description: >
JIMM version tag to use. This will decide the version of JIMM to start e.g. v3.1.7
A special tag of "dev" can be provided to use the current development version of JIMM.
required: true
juju-channel:
description: 'Juju snap channel to pass to charmed-kubernetes/actions-operator'
required: false
ghcr-pat:
description: 'PAT Token that has package:read access to canonical/JIMM'
description: >
PAT Token that has package:read access to canonical/JIMM
The PAT token can be left empty when building the development version of JIMM.
required: true

output:
Expand All @@ -27,16 +31,22 @@ runs:
using: "composite"
steps:
- name: Login to GitHub Container Registry
if: ${{ inputs.jimm-version != 'dev' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.ghcr-pat }}
- name: Start server and dependencies
- name: Start server based on released version
if: ${{ inputs.jimm-version != 'dev' }}
run: make integration-test-env
shell: bash
env:
JIMM_VERSION: ${{ inputs.jimm-version }}
- name: Start server based on development version
if: ${{ inputs.jimm-version == 'dev' }}
run: make dev-env
shell: bash
- name: Initialise LXD
run: |
sudo lxd waitready && \
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@ jobs:
steps:
- name: Checkout JIMM repo
uses: actions/checkout@v4
- name: Setup Go
if: ${{ github.event_name == 'pull_request' }}
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Go vendor to speed up docker build
if: ${{ github.event_name == 'pull_request' }}
run: go mod vendor
- name: Start JIMM (fixed version)
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/test-server
with:
jimm-version: v3.1.7
jimm-version: dev
juju-channel: "3/stable"
ghcr-pat: ${{ secrets.GITHUB_TOKEN }}
- name: Start JIMM (user provided version)
Expand Down

0 comments on commit 195794f

Please sign in to comment.