Skip to content

release: merge main -> dev #154

release: merge main -> dev

release: merge main -> dev #154

name: Portal Lint and Test Chart
on:
push:
paths:
- 'charts/portal/**'
branches: [main, dev, release-candidate]
pull_request:
paths:
- 'charts/portal/**'
workflow_dispatch:
inputs:
node_image:
description: 'kindest/node image for k8s kind cluster'
# k8s version from 3.1 release
default: 'kindest/node:v1.24.6'
required: false
type: string
upgrade_from:
description: 'portal chart version to upgrade from'
# portal version from 3.1 release
default: '1.3.0'
required: false
type: string
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@v2
with:
version: v0.19.0
node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.24.6' }}
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.10.3
# Setup python as a prerequisite for chart linting
- uses: actions/setup-python@v4
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
# run chart linting
- name: Run chart-testing (lint)
run: ct lint --charts charts/portal --config charts/chart-testing-config.yaml
- name: Run helm install
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev
helm install portal charts/portal --namespace install --create-namespace
if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'
# Upgrade the released portal chart version with the locally available chart
- name: Run helm upgrade
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev
helm install portal tractusx-dev/portal --version ${{ github.event.inputs.upgrade_from || '1.3.0' }} --namespace upgrade --create-namespace
helm dependency update charts/portal
helm upgrade portal charts/portal --namespace upgrade
if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'