Skip to content

Generate secret connection environment variables #1126

Generate secret connection environment variables

Generate secret connection environment variables #1126

# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
---
name: Validate Resource Types
on:
push:
branches: [main]
paths:
- "**/kubernetes/**"
- "**/test/app.bicep"
- "**/*.yaml"
- ".github/workflows/validate-resource-types.yaml"
- ".github/scripts/**"
- ".github/build/**"
- "Makefile"
# No paths filter on pull_request: these are local (k3d) tests with no cloud
# cost, so the workflow runs on every PR and the required checks always report.
pull_request:
branches: [main]
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
version:
description: "Radius version number to use (e.g. 0.51.0, 0.51.0-rc1, edge)."
required: false
default: edge
type: string
permissions: {}
jobs:
validate-release-automation:
name: Validate Release Automation
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Run release automation tests
run: make test-release-automation
validate-resource-types:
name: Validate Resource Types and Recipes
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
recipe: [bicep, terraform]
permissions:
contents: read
env:
RAD_ENVIRONMENT_NAME: default
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .node-version
- name: Set up ORAS
uses: oras-project/setup-oras@1d808f7d7f6995cc68b7bf507bfe5c5446e1dc9d # v2.0.1
with:
version: "1.2.0"
- name: Install Radius CLI
run: make install-radius-cli RAD_VERSION="${{ inputs.version || 'edge' }}"
# this setups a local k3d cluster for testing purposes, creates workspace, group and env preview
- name: Create Radius Cluster
run: make create-radius-cluster
- name: Build Recipes
run: RECIPE_PLATFORM_FILTER=kubernetes make build
# Generates the bicep definition for recipe pack in recipe-pack-{bicep|terraform}.bicep
- name: Generate Recipe Pack
run: RECIPE_PLATFORM_FILTER=kubernetes make generate-recipe-pack PACK_NAME=${{ matrix.recipe }}recipepack OUTPUT_FILE=recipe-pack-${{ matrix.recipe }}.bicep
# Useful for debugging
# - name: Show Recipe Pack Content
# run: cat recipe-pack-${{ matrix.recipe }}.bicep
- name: Deploy Recipe Pack
run: make deploy-recipe-pack BICEP_FILE=recipe-pack-${{ matrix.recipe }}.bicep
- name: Update Environment with Recipe Pack
run: make update-env-recipe-pack RECIPE_PACK_NAME=${{ matrix.recipe }}recipepack ENVIRONMENT="${RAD_ENVIRONMENT_NAME}"
- name: Test ${{ matrix.recipe }} recipes
run: RECIPE_PLATFORM_FILTER=kubernetes make test ENVIRONMENT="$RAD_ENVIRONMENT_NAME" RECIPE_TYPE=${{ matrix.recipe }}
- name: Collect Radius pod logs
if: always()
run: |
mkdir -p radius-pod-logs
APP_POD=$(kubectl get pods -n radius-system -o json | jq -r '.items[] | select(.metadata.name | startswith("applications-rp-")) | .metadata.name' | head -n1)
if [ -n "$APP_POD" ]; then
kubectl logs "$APP_POD" -n radius-system --all-containers > radius-pod-logs/applications-rp.log || true
else
echo "applications-rp pod not found" > radius-pod-logs/applications-rp.log
fi
DE_POD=$(kubectl get pods -n radius-system -o json | jq -r '.items[] | select(.metadata.name | test("^(deployment-engine|bicep-de)-")) | .metadata.name' | head -n1)
if [ -n "$DE_POD" ]; then
kubectl logs "$DE_POD" -n radius-system --all-containers > radius-pod-logs/deployment-engine.log || true
else
echo "deployment engine pod not found" > radius-pod-logs/deployment-engine.log
fi
UCP_POD=$(kubectl get pods -n radius-system -o json | jq -r '.items[] | select(.metadata.name | startswith("ucp-")) | .metadata.name' | head -n1)
if [ -n "$UCP_POD" ]; then
kubectl logs "$UCP_POD" -n radius-system --all-containers > radius-pod-logs/ucp.log || true
else
echo "ucp pod not found" > radius-pod-logs/ucp.log
fi
DRP_POD=$(kubectl get pods -n radius-system -o json | jq -r '.items[] | select(.metadata.name | startswith("dynamic-rp-")) | .metadata.name' | head -n1)
if [ -n "$DRP_POD" ]; then
kubectl logs "$DRP_POD" -n radius-system --all-containers > radius-pod-logs/dynamic-rp.log || true
else
echo "dynamic-rp pod not found" > radius-pod-logs/dynamic-rp.log
fi
- name: Upload Radius pod logs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: radius-pod-logs-${{ matrix.recipe }}
path: radius-pod-logs
if-no-files-found: warn