Skip to content

Commit

Permalink
chore(follow-up): use directory-based structure (#1988)
Browse files Browse the repository at this point in the history
* simplify getting the previous chart version in workflow-vars

* update working dir in chart-release-snapshot.yaml

* use unit test template

---------

Signed-off-by: Ahmed AbouZaid <6760103+aabouzaid@users.noreply.github.com>
  • Loading branch information
aabouzaid committed Jul 13, 2024
1 parent c5ac21b commit c2a5f15
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 60 deletions.
18 changes: 4 additions & 14 deletions .github/actions/workflow-vars/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,11 @@ runs:
- name: Set workflow vars - Chart version
shell: bash
run: |
# Chart version.
# Used to install previous supported versions of Camunda Helm charts.
# This is only needed in the upgrade flow not the setup.
get_latest_released_chart_by_app_version() {
app_version="${1}"
helm repo add camunda https://helm.camunda.io > /dev/null
helm search repo camunda/camunda-platform --versions --output json |
jq -r --arg app_version "$app_version" \
'[.[] | select (.app_version == $app_version)] | first | .version'
}
# In the upgrade flow, the latest released chart for certain minor Camunda version will installed,
# then upgraded from the PR branch to ensure upgradability.
if [[ "${{ inputs.setup-flow }}" == 'upgrade' ]]; then
app_version="$(yq '.appVersion' charts/${{ inputs.chart-dir }}/Chart.yaml)"
TEST_CHART_VERSION="$(get_latest_released_chart_by_app_version ${app_version})"
git fetch origin main:main --no-tags
TEST_CHART_VERSION="$(git show main:charts/${{ inputs.chart-dir }}/Chart.yaml | yq '.version')"
echo "TEST_CHART_VERSION=${TEST_CHART_VERSION}" | tee -a $GITHUB_ENV
fi
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/chart-release-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- 265-aa-follow-up

jobs:
release:
Expand All @@ -16,7 +17,7 @@ jobs:
defaults:
run:
shell: bash
working-directory: charts/camunda-platform
working-directory: charts/camunda-platform-latest
#
# Vars.
env:
Expand Down
55 changes: 10 additions & 45 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
branches:
- main
paths:
- '.github/*unit*'
- '.tool-versions'
- '.github/workflows/test-unit*'
- 'charts/camunda-platform*/**'
- 'go.*'
pull_request:
paths:
- '.github/*unit*'
- '.tool-versions'
- '.github/workflows/test-unit*'
- 'charts/camunda-platform*/**'
- 'go.*'
workflow_dispatch: { }
Expand All @@ -21,46 +21,11 @@ permissions:
contents: read

jobs:
test:
name: Custom values - ${{ matrix.test.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test:
- name: Core
packages: camunda identity console
- name: Apps
packages: connectors operate optimize tasklist
- name: Zeebe
packages: zeebe zeebe-gateway
- name: WebModeler
packages: web-modeler
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- name: Install env dependencies
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Format
run: make go.fmt
- name: Install License Tool
run: |
make go.addlicense-install
asdf reshim golang
- name: Check License
run: make go.addlicense-check
- name: Add helm repos
run: make helm.repos-add
- name: Get Helm dependency
run: make helm.dependency-update
- name: ⭐️ Test ⭐️
run: |
cd charts/camunda-platform-latest/test/unit
go test $(printf "./%s " ${{ matrix.test.packages }})
unit:
name: Unit Test - Camunda latest
needs: init
uses: ./.github/workflows/test-unit-template.yml
with:
identifier: "${{ github.event.pull_request.number }}-unit-latest"
camunda-helm-dir: "camunda-platform-latest"
camunda-helm-git-ref: "${{ github.event.pull_request.head.sha }}"

0 comments on commit c2a5f15

Please sign in to comment.