diff --git a/.github/workflows/chart-test.yaml b/.github/workflows/chart-test.yaml index 3bf4391e..00543db9 100644 --- a/.github/workflows/chart-test.yaml +++ b/.github/workflows/chart-test.yaml @@ -84,3 +84,22 @@ jobs: if: ${{ github.ref == 'refs/heads/main' }} run: ct install --target-branch main --all --chart-dirs charts --chart-dirs other-charts continue-on-error: true + + check-versions-connect: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.6.3 + + - uses: extractions/setup-just@v2 + + - name: Run executable verification for default interpreters + run: | + just test-connect-interpreter-versions diff --git a/Justfile b/Justfile index a4a5cf76..9afbf6f2 100644 --- a/Justfile +++ b/Justfile @@ -67,3 +67,34 @@ snapshot-rsw-diff: {{ DIFF }} $file $file.lock fi done + +test-connect-interpreter-versions: + #!/usr/bin/env bash + set -xe + cd ./charts/rstudio-connect && helm dependency build && cd - + + # find the default image + image=$( + helm template ./charts/rstudio-connect \ + --show-only templates/deployment.yaml | \ + grep "image\:.*rstudio-connect.*" | \ + awk -F": " '{print $2}' | \ + xargs) + + for lang in "Python" "Quarto" "R" + do + # print the default connect config file for local execution in ini format + # print the section and grep for the Executables to find each interpreter + executables=$( + helm template ./charts/rstudio-connect \ + --set config.Launcher.Enabled=false \ + --show-only templates/configmap.yaml | \ + sed -n -e "/\[$lang\]/,/\[*\]/ p" | \ + grep Executable | awk -F= '{print $2}' | \ + xargs) + + for ex in $executables + do + docker run --rm $image /bin/bash -c "command -v $ex" + done + done