Skip to content

Commit

Permalink
ci: run only on changed versions
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed AbouZaid <[email protected]>
  • Loading branch information
aabouzaid committed Oct 21, 2024
1 parent 1590863 commit 0abe7da
Show file tree
Hide file tree
Showing 12 changed files with 1,149 additions and 42 deletions.
46 changes: 46 additions & 0 deletions .github/actions/generate-versions-matrix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Generate version matrix
description: Find changed/unchanged versions and generate matrix for them to be used in GHA workflow matrix.

inputs:
versions-path:
description: Versions path to match.
required: true

outputs:
unchanged:
description: JSON matrix of unchanged versions which will be used as and input for GHA workflow matrix exclude.
value: ${{ steps.get-versions.outputs.matrix-unchanged }}

runs:
using: composite
steps:
- name: Get changed dirs
id: changed-files
uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c # v45
with:
dir_names: "true"
- name: Generate matrix
shell: bash
id: get-versions
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
UNCHANGED_VERSIONS_TMP_FILE: unchanged_versions.txt
run: |
echo "Setting matrix based on changed files"
echo "Changed files:"
printf "%s\n" ${ALL_CHANGED_FILES}
touch ${UNCHANGED_VERSIONS_TMP_FILE}
ls -d ${{ inputs.versions-path }} | while read version_dir; do
if [[ $(echo ${ALL_CHANGED_FILES} | grep "${version_dir}") ]]; then
continue
else
camunda_version="$(echo ${version_dir} | rev | cut -d '-' -f 1 | rev)";
echo "Camunda version: ${camunda_version}"
echo "${camunda_version}" >> ${UNCHANGED_VERSIONS_TMP_FILE};
fi
done
# NOTE: The keys "versions" and "camunda-version" are hard-coded and should be used in the workflow matrix.
matrix_unchanged="$(cat ${UNCHANGED_VERSIONS_TMP_FILE} |
jq -s -c -R 'split("\n") | .[:-1] | map({"versions": {"camunda-version": .}})')"
echo "matrix-unchanged=${matrix_unchanged}" | tee -a $GITHUB_OUTPUT
38 changes: 0 additions & 38 deletions .github/workflows/docker-compose-e2e-setup.yaml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/docker-compose-test-e2e-full-setup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "Docker Compose | Test - E2E - Full Setup"
on:
push:
branches:
- main
paths:
- docker-compose/versions/**
pull_request:
paths:
- .github/workflows/docker-compose-test-e2e-template.yaml
- .github/workflows/docker-compose-test-e2e-full-setup.yaml
- docker-compose/versions/**

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true

jobs:
init:
name: Generate version matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Generate versions
id: generate-versions-matrix
uses: ./.github/actions/generate-versions-matrix
with:
versions-path: "docker-compose/versions/camunda-8.*"
outputs:
unchanged-versions: ${{ steps.generate-versions-matrix.outputs.unchanged }}

exec:
needs: [init]
name: ${{ matrix.versions.name }}
strategy:
fail-fast: false
matrix:
versions:
- name: Camunda 8.3
camunda-version: "8.3"
compose-args: "-f docker-compose.yaml -f docker-compose-web-modeler.yaml"
- name: Camunda 8.4
camunda-version: "8.4"
compose-args: "-f docker-compose.yaml -f docker-compose-web-modeler.yaml"
- name: Camunda 8.5
camunda-version: "8.5"
compose-args: "-f docker-compose.yaml -f docker-compose-web-modeler.yaml"
- name: Camunda 8.6
camunda-version: "8.6"
compose-args: "--profile full"
- name: Camunda Alpha
camunda-version: "alpha"
compose-args: "--profile full"
exclude: ${{ fromJson(needs.init.outputs.unchanged-versions) }}
uses: ./.github/workflows/docker-compose-test-e2e-template.yaml
secrets: inherit
with:
camunda-version: ${{ matrix.versions.camunda-version }}
compose-args: ${{ matrix.versions.compose-args }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Docker Compose | Template - E2E Test - Setup"
name: "Docker Compose | Test - E2E - Template"

on:
workflow_call:
Expand All @@ -13,8 +13,8 @@ on:
type: string
e2e-test-enabled:
description: Run Playwright tests
required: true
type: boolean
default: true
e2e-test-directory:
description: Directory of the E2E files
required: false
Expand All @@ -29,8 +29,9 @@ env:
COMPOSE_WORKING_DIRECTORY: docker-compose/versions/camunda-${{ inputs.camunda-version }}

jobs:
test:
name: Test
run:
# if: contains(inputs.changed-versions, inputs.camunda-version)
name: Run
runs-on: ubuntu-latest
steps:
- name: disable and stop mono-xsp4.service
Expand Down
35 changes: 35 additions & 0 deletions docker-compose/versions/camunda-alpha/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Image versions ##
# renovate: datasource=docker depName=camunda/connectors-bundle
CAMUNDA_CONNECTORS_VERSION=8.6.2
# renovate: datasource=docker depName=camunda/zeebe
CAMUNDA_PLATFORM_VERSION=8.6.1
# renovate: datasource=docker depName=camunda/optimize
CAMUNDA_OPTIMIZE_VERSION=8.6.1
# renovate: datasource=docker depName=camunda/web-modeler-restapi
CAMUNDA_WEB_MODELER_VERSION=8.6.2
# renovate: datasource=docker depName=elasticsearch
ELASTIC_VERSION=8.15.3
KEYCLOAK_SERVER_VERSION=24.0.5
# renovate: datasource=docker depName=axllent/mailpit
MAILPIT_VERSION=v1.20.7
POSTGRES_VERSION=14.5-alpine
HOST=localhost
KEYCLOAK_HOST=localhost

## Configuration ##
# By default the zeebe api is public, when setting this to `identity` a valid zeebe client token is required
ZEEBE_AUTHENTICATION_MODE=none
ZEEBE_CLIENT_ID=zeebe
ZEEBE_CLIENT_SECRET=zecret

# Set to 'true' to enable resource based authorizations for users and groups
# This can be used to limit access for users or groups to view/update specific
# processes and decisions in Operate and Tasklist
RESOURCE_AUTHORIZATIONS_ENABLED=false

# Set to 'true' to enable multi-tenancy across all components
# This requires use of identity for authentication
#
# ZEEBE_AUTHENTICATION_MODE=identity
#
MULTI_TENANCY_ENABLED=false
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
es:
settings:
index:
number_of_replicas: 0

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CAMUNDA_MODELER_CLUSTERS_0_AUTHENTICATION: oauth
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CAMUNDA_MODELER_CLUSTERS_0_AUTHENTICATION: none
Loading

0 comments on commit 0abe7da

Please sign in to comment.