Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed AbouZaid <[email protected]>
  • Loading branch information
aabouzaid committed Oct 20, 2024
1 parent 75fef9d commit b247edd
Show file tree
Hide file tree
Showing 12 changed files with 1,113 additions and 277 deletions.
42 changes: 42 additions & 0 deletions .github/actions/generate-changed-versions-matrix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Generate version matrix
description: Find changed versions and generate matrix for changed ones only.

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

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

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: set-version-versions
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Setting matrix based on changed files"
echo "Changed files:"
printf "%s\n" ${ALL_CHANGED_FILES}
touch matrix_versions.txt
ls -d ${{ inputs.versions-path }} | while read version_dir; do
if [[ $(echo ${ALL_CHANGED_FILES} | grep "${version_dir}") ]]; then
camunda_version="$(echo ${version_dir} | rev | cut -d '-' -f 1 | rev)";
echo "Camunda version: ${camunda_version}"
echo "${camunda_version}" >> matrix_versions.txt;
fi
done
matrix="$(cat matrix_versions.txt | jq -s -c -R 'split("\n") | .[:-1] | map(camunda-version: .)')"
echo "matrix=${matrix}" | tee -a $GITHUB_OUTPUT
32 changes: 23 additions & 9 deletions .github/workflows/docker-compose-e2e-setup.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Docker Compose | E2E Test - Setup"
name: "Docker Compose | Test - E2E"
on:
push:
branches:
Expand All @@ -8,31 +8,45 @@ on:
- docker-compose/versions/**

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

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

on:
workflow_call:
inputs:
# changed-versions:
# description: Items changed to avoid extra workflow run
# required: true
# type: string
camunda-version:
description: Camunda minor version in format x.y
required: true
Expand All @@ -13,8 +17,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 +33,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
Loading

0 comments on commit b247edd

Please sign in to comment.