From 4a728b7f927e6438af87ed98236551e9cec01821 Mon Sep 17 00:00:00 2001 From: David Kegley Date: Tue, 30 Apr 2024 11:55:06 -0400 Subject: [PATCH] Add GHA for testing Connect interpreter versions --- .github/workflows/chart-test.yaml | 20 ++++++++++++++++++++ Justfile | 31 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/.github/workflows/chart-test.yaml b/.github/workflows/chart-test.yaml index 3bf4391e..46d0d42c 100644 --- a/.github/workflows/chart-test.yaml +++ b/.github/workflows/chart-test.yaml @@ -84,3 +84,23 @@ 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..a436dfcc 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 -it $image command -v $ex + done + done