ACS-8607: Create Helm chart for hxi-connector #1212
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and Test Charts | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- labeled | |
paths: | |
- 'charts/**' | |
- '!charts/**/README.md' | |
- '!charts/**/README.md.gotmpl' | |
- '!charts/**/docs/**' | |
jobs: | |
lint-test: | |
runs-on: ubuntu-latest | |
env: | |
INSTALL_NAMESPACE: alfresco | |
# See https://github.com/kubernetes-sigs/kind/releases for the latest available images | |
KIND_VERSION: v0.22.0 | |
KIND_NODE_IMAGE: kindest/node:v1.29.2@sha256:51a1434a5397193442f0be2a297b488b6c919ce8a3931be0ce822606ea5ca245 | |
TEST_ALL_CHARTS: ${{ contains(github.event.pull_request.labels.*.name, 'ci-test-all') && 'true' || 'false' }} | |
TEST_ALL_CHARTS_ARG: ${{ contains(github.event.pull_request.labels.*.name, 'ci-test-all') && '--all' || '' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
with: | |
fetch-depth: 0 | |
- name: Set up Helm | |
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 | |
with: | |
version: v3.10.2 | |
- name: Set up Unit Test plugin for Helm | |
env: | |
HELM_UNITTEST_VERSION: v0.4.1 | |
run: | | |
helm plugin install https://github.com/helm-unittest/helm-unittest --version $HELM_UNITTEST_VERSION | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1 | |
with: | |
version: v3.10.1 | |
- name: Run chart-testing (list-changed) | |
id: list-changed | |
run: | | |
changed=$(ct list-changed --config ct.yaml) | |
if [[ -n "$changed" || "$TEST_ALL_CHARTS" == "true" ]]; then | |
echo "changed=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Run chart-testing (lint) | |
if: steps.list-changed.outputs.changed == 'true' | |
run: ct lint --config ct.yaml $TEST_ALL_CHARTS_ARG | |
- name: Create kind cluster | |
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0 | |
with: | |
version: ${{ env.KIND_VERSION}} | |
node_image: ${{ env.KIND_NODE_IMAGE }} | |
if: steps.list-changed.outputs.changed == 'true' | |
- name: Login to Quay.io | |
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 | |
if: steps.list-changed.outputs.changed == 'true' | |
with: | |
registry: quay.io | |
username: ${{ secrets.quay_username }} | |
password: ${{ secrets.quay_password }} | |
- name: Get Activiti License from S3 | |
if: steps.list-changed.outputs.changed == 'true' | |
env: | |
AWS_REGION: us-east-1 | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACSLICENSE_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_ACSLICENSE_SECRET_ACCESS_KEY }} | |
run: aws s3 cp s3://aps-licenses/single-tenant/activiti.lic /tmp/activiti.lic | |
- name: Prepare namespace for install | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
kubectl create ns "$INSTALL_NAMESPACE" | |
kubectl create secret generic quay-registry-secret --from-file=.dockerconfigjson="${HOME}"/.docker/config.json --type=kubernetes.io/dockerconfigjson -n "$INSTALL_NAMESPACE" | |
kubectl create secret generic broker-secret --from-literal=BROKER_URL="failover:(nio://activemq:61616)?timeout=3000" --from-literal=BROKER_USERNAME=admin --from-literal=BROKER_PASSWORD=admin -n "$INSTALL_NAMESPACE" | |
kubectl create secret generic aps-license --from-file=activiti.lic=/tmp/activiti.lic -n "$INSTALL_NAMESPACE" | |
- name: Prepare charts mocks for testing | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
ITER_CMD="ct lsc --config ct.yaml" | |
if [[ "$TEST_ALL_CHARTS" == "true" ]]; then | |
ITER_CMD="ls -1 charts | awk -v prefix='charts/' '{print prefix \$0}'" | |
fi | |
for C in $(eval $ITER_CMD); do | |
if [ -d "${C}/ci/kustomize/" ]; then | |
echo "Prepare mocks for ${C}" | |
pushd "${C}/ci/kustomize/" | |
kubectl kustomize --enable-helm . | \ | |
kubectl -n "$INSTALL_NAMESPACE" apply -f - | |
popd | |
fi | |
done | |
- name: Run chart-testing (install) | |
run: >- | |
ct install --config ct.yaml | |
--namespace "$INSTALL_NAMESPACE" | |
$TEST_ALL_CHARTS_ARG |