Skip to content

add support for custom CA for airgapped environments #214

add support for custom CA for airgapped environments

add support for custom CA for airgapped environments #214

Workflow file for this run

name: Test helm chart
on:
workflow_call:
inputs:
tag:
type: string
required: true
chartVersion:
type: string
required: true
chartName:
required: true
type: string
description: "Chartname to test"
workflow_dispatch:
inputs:
tag:
required: true
description: 'RocketChat tag to test'
chartVersion:
description: 'Chart version to test'
required: true
chartName:
required: true
type: string
description: "Name of the chart to test"
push:
paths:
- rocketchat/**
- monitoring/**
- bats/**
- mock/**
- .github/workflows/test.yml
- task.bash
env:
REPO: 'RocketChat/helm-charts'
TESTS_REPO: 'RocketChat/public-releases'
jobs:
# this 3 jobs will run in parallel for warming up the workflow
setup-docker:
runs-on: ubuntu-latest
steps:
- name: Setup docker
uses: docker/setup-docker-action@v4
setup-k3d:
runs-on: ubuntu-latest
steps:
- uses: nolar/setup-k3d-k3s@v1
with:
skip-creation: true
detect-changes:
runs-on: ubuntu-latest
outputs:
chartNames: ${{ steps.set-chartname.outputs.chartname }}
runMock: ${{ steps.set-chartname.outputs.run_mock }}
steps:
- name: Clone helm chart repository
uses: actions/checkout@v3
with:
submodules: true
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
- name: Set chartname variable
id: set-chartname
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
INPUT_CHART_NAME: ${{ inputs.chartName }}
run: |
chartNames=()
changed_files="${ALL_CHANGED_FILES}"
run_mock="0"
if [[ -z "$changed_files" ]]; then
echo "No changed files detected"
elif [[ -n "${INPUT_CHART_NAME}" ]]; then
chartNames+=(${INPUT_CHART_NAME})
else
if echo "$changed_files" | grep -qE 'rocketchat/'; then
chartNames+=("rocketchat")
run_mock=1
fi
if echo "$changed_files" | grep -qE 'monitoring/'; then
chartNames+=("monitoring")
run_mock=1
fi
# if ci things are changed retest all charts
if echo "$changed_files" | grep -qE 'bats/|mock/|test.yml|task.bash'; then
chartNames+=("rocketchat" "monitoring")
run_mock=1
fi
fi
# Remove duplicates
unique_chartNames=($(printf "%s\n" "${chartNames[@]}" | sort -u))
# Build JSON array string
json_array=$(printf '"%s",' "${unique_chartNames[@]}")
json_array="[${json_array%,}]"
echo "runMock=${run_mock}" | tee -a $GITHUB_OUTPUT
echo "chartname=${json_array}" | tee -a $GITHUB_OUTPUT
mock:
if: ${{ needs.detect-changes.outputs.chartNames }} != [""]

Check warning on line 111 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Test helm chart

Workflow syntax warning

.github/workflows/test.yml (Line: 111, Col: 9): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
needs:
- detect-changes
- setup-docker
- setup-k3d
strategy:
matrix:
chartName: ${{ fromJson(needs.detect-changes.outputs.chartNames) }}
runs-on: ubuntu-latest
steps:
- name: Clone helm chart repository
uses: actions/checkout@v3
with:
submodules: true
- run: ./task.bash mock "${{ matrix.chartName }}"
cluster:
needs:
- detect-changes
- mock
strategy:
matrix:
chartName: ${{ fromJson(needs.detect-changes.outputs.chartNames) }}
runs-on: ubuntu-latest
steps:
- name: Clone helm chart repository
uses: actions/checkout@v3
with:
submodules: true
- uses: nolar/setup-k3d-k3s@v1
with:
skip-creation: true
- run: ./task.bash cluster "${{ matrix.chartName }}"