fix: set websocket URL env vars regardless of ingress config #453
This file contains hidden or 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 | |
| jobs: | |
| lint-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: v3.17.2 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.13 | |
| - name: Set up chart-testing | |
| uses: helm/chart-testing-action@v2.7.0 | |
| - 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 | |
| - name: Run chart-testing (lint) | |
| if: steps.list-changed.outputs.changed == 'true' | |
| run: ct lint --target-branch ${{ github.event.repository.default_branch }} | |
| - name: Test websocket env vars (no ingress) | |
| if: steps.list-changed.outputs.changed == 'true' | |
| run: | | |
| helm template test ./charts/rcon-web-admin \ | |
| -f ./charts/rcon-web-admin/ci/websocket-lb-values.yaml \ | |
| --no-hooks > /tmp/rendered.yaml | |
| if ! grep -q "name: RWA_WEBSOCKET_URL" /tmp/rendered.yaml; then | |
| echo "ERROR: RWA_WEBSOCKET_URL env var is missing" | |
| exit 1 | |
| fi | |
| if ! grep -q "name: RWA_WEBSOCKET_URL_SSL" /tmp/rendered.yaml; then | |
| echo "ERROR: RWA_WEBSOCKET_URL_SSL env var is missing" | |
| exit 1 | |
| fi | |
| echo "PASS: Websocket env vars present without ingress" | |
| - name: Test websocket env vars (with ingress) | |
| if: steps.list-changed.outputs.changed == 'true' | |
| run: | | |
| helm template test ./charts/rcon-web-admin \ | |
| -f ./charts/rcon-web-admin/ci/websocket-ingress-values.yaml \ | |
| --no-hooks > /tmp/rendered.yaml | |
| if ! grep -q "name: RWA_WEBSOCKET_URL" /tmp/rendered.yaml; then | |
| echo "ERROR: RWA_WEBSOCKET_URL env var is missing with ingress" | |
| exit 1 | |
| fi | |
| if ! grep -q "name: RWA_WEBSOCKET_URL_SSL" /tmp/rendered.yaml; then | |
| echo "ERROR: RWA_WEBSOCKET_URL_SSL env var is missing with ingress" | |
| exit 1 | |
| fi | |
| echo "PASS: Websocket env vars present with ingress" | |
| - name: Create kind cluster | |
| if: steps.list-changed.outputs.changed == 'true' | |
| uses: helm/kind-action@v1.12.0 | |
| - name: Install LoadBalancer | |
| if: steps.list-changed.outputs.changed == 'true' | |
| run: |- | |
| kubectl config use-context kind-chart-testing | |
| kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml | |
| kubectl apply -f .github/metallb-configmap.yaml | |
| - name: Run chart-testing (install) | |
| if: steps.list-changed.outputs.changed == 'true' | |
| run: ct install --target-branch ${{ github.event.repository.default_branch }} |