Skip to content

Commit

Permalink
Helm integration tests for release branches (#2612)
Browse files Browse the repository at this point in the history
* ci: test patches for older minor versions with correct dependencies

* fix workflow

* add prepare java

* add result logging

* add result logging

* setup java

* use newer syntax to set outputs

* try running mvn in offline mode for faster execution

* fix id

* simplify mvn version check

* fix connectors version

* Apply branding :)

Co-authored-by: Igor Petrov <108870003+igpetrov@users.noreply.github.com>

---------

Co-authored-by: Igor Petrov <108870003+igpetrov@users.noreply.github.com>
(cherry picked from commit 3cf7393)
  • Loading branch information
chillleader committed May 27, 2024
1 parent 289c9e1 commit 20007ae
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 5 deletions.
66 changes: 61 additions & 5 deletions .github/workflows/INTEGRATION_TEST.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
name: Integration test

on:
push:
branches:
- release/*
workflow_dispatch:
inputs:
connectors_version:
description: 'The version of the connectors to test'
required: true
default: 'SNAPSHOT'
connectors-version:
description: 'The version of the Connectors to test. If not provided, the version is determined based on the Maven project version. On main branch, the default is SNAPSHOT'
required: false
helm-branch:
description: 'The branch of the Helm chart to test against. If not provided, the branch is determined based on the ref (see helm-git-refs.json)'
required: false

defaults:
run:
Expand All @@ -16,14 +21,65 @@ defaults:
shell: bash

jobs:
prepare-inputs:
runs-on: ubuntu-latest
name: Prepare inputs
outputs:
connectors-version: ${{ steps.connectors-version.outputs.connectors-version }}
helm-branch: ${{ steps.helm-branch.outputs.helm-branch }}
steps:
- uses: actions/checkout@v2

- name: Install jq
run: sudo apt-get install jq

- name: Determine current Maven project version
id: maven-version
run: |
echo "version=$(grep -oPm1 "(?<=<version>)[^<]+" "pom.xml")" >> $GITHUB_OUTPUT
- name: Determine version of the Connectors image to use
id: connectors-version
run: |
if [ -z "${{ github.event.inputs.connectors-version }}" ]; then
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "connectors-version=SNAPSHOT" >> $GITHUB_OUTPUT
else
echo "connectors-version=${{ steps.maven-version.outputs.version }}" >> $GITHUB_OUTPUT
fi
else
echo "connectors-version=${{ github.event.inputs.connectors-version }}" >> $GITHUB_OUTPUT
fi
- name: Determine Helm chart ref to use
id: helm-branch
run: |
if [ -z "${{ github.event.inputs.helm-branch }}" ]; then
helm_branch=$(jq -r ".[\"${{ github.ref }}\"]" .github/workflows/helm-git-refs.json)
if [ -z "$helm_branch" ] || [ "$helm_branch" == "null" ]; then
echo "::error::Could not determine Helm chart branch to use, please provide helm-branch input or adjust the mappings in .github/workflows/helm-git-refs.json"
exit 1
fi
echo "helm-branch=$helm_branch" >> $GITHUB_OUTPUT
else
echo "helm-branch=${{ github.event.inputs.helm-branch }}" >> $GITHUB_OUTPUT
fi
- name: Log results
run: |
echo "Connectors version: ${{ steps.connectors-version.outputs.connectors-version }}"
echo "Helm branch: ${{ steps.helm-branch.outputs.helm-branch }}"
helm-deploy:
needs: prepare-inputs
name: Helm chart Integration Tests
uses: camunda/camunda-platform-helm/.github/workflows/test-integration-template.yaml@main
secrets: inherit
with:
identifier: connectors-int
camunda-helm-git-ref: ${{ needs.prepare-inputs.outputs.helm-branch }}
test-enabled: true
extra-values: |
connectors:
image:
tag: ${{ github.event.inputs.connectors_version }}
tag: ${{ needs.prepare-inputs.outputs.connectors-version }}
7 changes: 7 additions & 0 deletions .github/workflows/helm-git-refs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"refs/heads/main": "main",
"refs/heads/release/8.6": "main",
"refs/heads/release/8.5": "main",
"refs/heads/release/8.4": "camunda-platform-8.4",
"refs/heads/release/8.3": "camunda-platform-8.3"
}

0 comments on commit 20007ae

Please sign in to comment.