From 7cd37c48db7361f938668bfea2383f1ead80f94d Mon Sep 17 00:00:00 2001 From: sk593 Date: Tue, 23 Jul 2024 15:16:57 -0700 Subject: [PATCH] move noncloud publishing to test step Signed-off-by: sk593 --- .github/workflows/functional-test-cloud.yaml | 8 ++- .../workflows/functional-test-noncloud.yaml | 68 +++++++------------ 2 files changed, 31 insertions(+), 45 deletions(-) diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index 9e427df3654..c812b0e87c0 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -90,6 +90,8 @@ env: TF_RECIPE_PRIVATE_GIT_SOURCE: "git::https://github.com/radius-project/terraform-private-modules//kubernetes-redis" # The number of failed tests to report. ISSUE_CREATE_THRESHOLD: 2 + # bicep-types ACR url for uploading Radius Bicep types + BICEP_TYPES_REGISTRY: 'biceptypes.azurecr.io' jobs: build: @@ -386,7 +388,7 @@ jobs: bicep --version - name: Publish bicep types run: | - bicep publish-extension ./hack/bicep-types-radius/generated/index.json --target br:${{ env.BICEP_TYPES_REGISTRY }}/test/radius/cloud:${{ env.REL_VERSION == 'edge' && 'latest' || env.REL_VERSION }} --force + bicep publish-extension ./hack/bicep-types-radius/generated/index.json --target br:${{ env.BICEP_TYPES_REGISTRY }}/test/radius:${{ env.REL_VERSION == 'edge' && 'latest' || env.REL_VERSION }} --force tests: name: Run ${{ matrix.name }} functional tests @@ -647,8 +649,8 @@ jobs: "dynamicTypeLoading": true }, "extensions": { - "radius": "br:biceptypes.azurecr.io/test/radius/cloud:$RADIUS_VERSION", - "aws": "br:biceptypes.azurecr.io/aws:latest" + "radius": "br:${{ env.BICEP_TYPES_REGISTRY }}/test/radius:$RADIUS_VERSION", + "aws": "br:${{ env.BICEP_TYPES_REGISTRY }}/aws:latest" } } EOF diff --git a/.github/workflows/functional-test-noncloud.yaml b/.github/workflows/functional-test-noncloud.yaml index d031ed3c551..2ac100f5815 100644 --- a/.github/workflows/functional-test-noncloud.yaml +++ b/.github/workflows/functional-test-noncloud.yaml @@ -80,6 +80,8 @@ env: LOCAL_REGISTRY_SERVER: "localhost" # Local Docker registry port LOCAL_REGISTRY_PORT: "5000" + # bicep-types ACR url for uploading Radius Bicep types + BICEP_TYPES_REGISTRY: 'biceptypes.azurecr.io' jobs: build: @@ -126,46 +128,7 @@ jobs: echo "REL_VERSION=pr-${UNIQUE_ID}" >> $GITHUB_OUTPUT echo "DE_IMAGE=${{ env.DE_IMAGE }}" >> $GITHUB_OUTPUT echo "DE_TAG=${{ env.DE_TAG }}" >> $GITHUB_OUTPUT - - publish-test-bicep-types: - name: Publish Radius bicep types to ACR - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - - name: Parse release version and set environment variables - run: python ./.github/scripts/get_release_version.py - - name: Set up Go ${{ env.GOVER }} - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GOVER }} - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: '18' - - name: Generate Bicep extensibility types from OpenAPI specs - run: | - make generate-bicep-types VERSION=${{ env.REL_VERSION == 'edge' && 'latest' || env.REL_VERSION }} - - name: Upload Radius Bicep types artifacts - uses: actions/upload-artifact@v4 - with: - name: radius-bicep-types - path: ./hack/bicep-types-radius/generated - if-no-files-found: error - - name: 'Login via Azure CLI' - uses: azure/login@v1 - with: - creds: ${{ secrets.BICEP_TYPES_AZURE_CREDENTIALS }} - - name: Setup and verify bicep CLI - run: | - curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 - chmod +x ./bicep - sudo mv ./bicep /usr/local/bin/bicep - bicep --version - - name: Publish bicep types - run: | - bicep publish-extension ./hack/bicep-types-radius/generated/index.json --target br:${{ env.BICEP_TYPES_REGISTRY }}/test/radius/noncloud:${{ env.REL_VERSION == 'edge' && 'latest' || env.REL_VERSION }} --force - + tests: name: Run ${{ matrix.name }} functional tests needs: build @@ -244,6 +207,22 @@ jobs: restore-keys: | ${{ runner.os }}-go- + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '18' + + - name: Generate Bicep extensibility types from OpenAPI specs + run: | + make generate-bicep-types VERSION=${{ env.REL_VERSION == 'edge' && 'latest' || env.REL_VERSION }} + + - name: Upload Radius Bicep types artifacts + uses: actions/upload-artifact@v4 + with: + name: radius-bicep-types + path: ./hack/bicep-types-radius/generated + if-no-files-found: error + - name: Create a secure local registry id: create-local-registry uses: ./.github/actions/create-local-registry @@ -349,6 +328,11 @@ jobs: BICEP_RECIPE_TAG_VERSION: ${{ env.REL_VERSION }} TEMP_CERT_DIR: ${{ steps.create-local-registry.outputs.temp-cert-dir }} SSL_CERT_FILE: ${{ steps.create-local-registry.outputs.temp-cert-dir }}/certs/${{ env.LOCAL_REGISTRY_SERVER }}/client.crt + + - name: Publish bicep types + run: | + ./.rad/bin/rad-bicep publish-extension ./hack/bicep-types-radius/generated/index.json --target br:${{ env.LOCAL_REGISTRY_SERVER }}:${{ env.LOCAL_REGISTRY_PORT }}/radius:${{ env.REL_VERSION == 'edge' && 'latest' || env.REL_VERSION }} --force + - name: Generate test bicepconfig.json run: | if [[ "${{ env.REL_VERSION }}" == "edge" ]]; then @@ -364,8 +348,8 @@ jobs: "dynamicTypeLoading": true }, "extensions": { - "radius": "br:biceptypes.azurecr.io/test/radius/noncloud:$RADIUS_VERSION", - "aws": "br:biceptypes.azurecr.io/aws:latest" + "radius": "br:${{ env.LOCAL_REGISTRY_SERVER }}:${{ env.LOCAL_REGISTRY_PORT }}/radius:$RADIUS_VERSION", + "aws": "br:${{ env.BICEP_TYPES_REGISTRY }}/aws:latest" } } EOF