Test helm chart #9
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: Test helm chart | |
on: | |
workflow_call: | |
inputs: | |
tag: | |
type: string | |
required: true | |
workflow_dispatch: | |
inputs: | |
tag: | |
required: false | |
env: | |
REPO: 'RocketChat/helm-charts' | |
TESTS_REPO: 'debdutdeb/rocket.chat.tests' | |
jobs: | |
can-i-run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get tag | |
id: tag | |
shell: bash | |
run: | | |
event=${{ github.event_name }} | |
if [[ $event == 'workflow_dispatch' ]]; then | |
if [[ -z '${{ inputs.tag }}' ]]; then | |
tag=$(curl -s https://releases.rocket.chat/rc/info | jq .tag -r) | |
elif [[ -z "$(curl -s https://releases.rocket.chat/${{ inputs.tag }}/info | jq -r '.tag // empty')" ]]; then | |
echo "::error::invalid tag ${{ inputs.tag }}" | |
exit 1 | |
fi | |
fi | |
echo "tag: $tag" | |
echo "tag=$tag" >>$GITHUB_OUTPUT | |
- name: Clone helm chart repository | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.REPO }} | |
path: ./helm-charts | |
- name: Clone tests | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.TESTS_REPO }} | |
path: tests | |
submodules: true | |
- name: Setup k3d | |
uses: AbsaOSS/k3d-action@main | |
with: | |
cluster-name: helm | |
- name: Run tests | |
shell: bash | |
env: | |
ROCKETCHAT_MAX_ATTEMPTS: 250 | |
ROCKETCHAT_TAG: ${{ steps.tag.outputs.tag }} | |
run: | | |
sudo apt-get install --no-install-recommends -y jo jq | |
export ROCKETCHAT_CHART_DIR="$(realpath ./helm-charts/rocketchat)" | |
cd tests && | |
bash run_k8s.bash | |