diff --git a/.github/actions/test-server/README.md b/.github/actions/test-server/README.md index 728e87213..2926efc38 100644 --- a/.github/actions/test-server/README.md +++ b/.github/actions/test-server/README.md @@ -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. \ No newline at end of file +For full details on the inputs see `action.yaml`. diff --git a/.github/actions/test-server/action.yaml b/.github/actions/test-server/action.yaml index 44ce7ff66..c2752ae03 100644 --- a/.github/actions/test-server/action.yaml +++ b/.github/actions/test-server/action.yaml @@ -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: @@ -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 && \ diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index ba3f05602..bec5052d0 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -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)