Add declarative execution environment management to rstudio-connect chart #3
Workflow file for this run
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: Helm Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "charts/rstudio-connect/**" | |
| - "!charts/rstudio-connect/README.md" | |
| - "!charts/rstudio-connect/README.md.gotmpl" | |
| - "!charts/rstudio-connect/NEWS.md" | |
| - ".github/workflows/helm-test.yaml" | |
| pull_request: | |
| paths: | |
| - "charts/rstudio-connect/**" | |
| - "!charts/rstudio-connect/README.md" | |
| - "!charts/rstudio-connect/README.md.gotmpl" | |
| - "!charts/rstudio-connect/NEWS.md" | |
| - ".github/workflows/helm-test.yaml" | |
| workflow_dispatch: | |
| jobs: | |
| helm-test: | |
| runs-on: ubuntu-latest-4x | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - chart: rstudio-connect | |
| base_values: ci/license-file-values.yaml | |
| values: ci/execution-environments.yaml | |
| license_secret: PCT_LICENSE_FILE | |
| license_name: pct-license | |
| license_file: pct.lic | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| - name: Add rstudio helm repo | |
| run: helm repo add rstudio https://helm.rstudio.com | |
| - name: Create kind cluster | |
| uses: helm/kind-action@v1 | |
| - name: Create namespace | |
| run: kubectl create namespace posit-test | |
| - name: Create license secret | |
| run: | | |
| echo "${{ secrets[matrix.license_secret] }}" > ${{ matrix.license_file }} | |
| kubectl create secret generic ${{ matrix.license_name }} --from-file=${{ matrix.license_file }} --namespace posit-test | |
| rm ${{ matrix.license_file }} | |
| - name: Build dependencies | |
| run: helm dependency build charts/${{ matrix.chart }} | |
| - name: Install chart | |
| run: | | |
| helm install ${{ matrix.chart }} charts/${{ matrix.chart }} \ | |
| --namespace posit-test \ | |
| --values charts/${{ matrix.chart }}/${{ matrix.base_values }} \ | |
| --values charts/${{ matrix.chart }}/${{ matrix.values }} \ | |
| --wait \ | |
| --timeout 5m | |
| - name: Run helm test | |
| run: helm test ${{ matrix.chart }} --namespace posit-test --timeout 5m | |
| - name: Debug on failure | |
| if: failure() | |
| run: | | |
| kubectl logs -l app.kubernetes.io/instance=${{ matrix.chart }} --namespace posit-test --tail=100 | |
| kubectl get pods --namespace posit-test | |
| kubectl describe pod -l helm.sh/hook=test --namespace posit-test |