diff --git a/.github/workflows/evergreen-build.yaml b/.github/workflows/evergreen-build.yaml new file mode 100644 index 0000000..eca7b2b --- /dev/null +++ b/.github/workflows/evergreen-build.yaml @@ -0,0 +1,222 @@ +name: Evergreen Build + +on: + workflow_call: + secrets: + build-secrets: + required: false + description: | + Docker BuildKit secrets in `id=value` format, one per line. + e.g. + ``` + FOO=bar + ``` + inputs: + cr-host: + required: false + type: string + default: "us-central1-docker.pkg.dev" + description: "Container registry hostname" + cr-login: + required: false + type: string + default: "_json_key" + description: "Username for container registry" + build-context: + required: false + type: string + default: "." + description: "Build context for docker build" + dockerfile: + required: false + type: string + default: "Dockerfile" + description: "Path to Dockerfile" + image-name: + required: true + type: string + description: "Name of the image, format quay.io/username/tenant-service or just username/tenant-service" + runner-label: + required: false + type: string + default: "ubuntu-latest" + description: "Runner name or label where to run" + build-args: + description: | + Build arguments in `KEY=VALUE` format, one per line. + e.g. + ``` + FOO=bar + BAZ=qux + ``` + required: false + default: "" + type: string + build-target: + description: "Docker build target stage" + required: false + type: string + default: "" + run-test: + required: false + type: string + description: "Path to test results or test configuration" + default: "" + free-runner-disk-space: + description: "Free disk space on runner. Can be enabled in case image build fails because of disk space issues." + type: boolean + required: false + default: false + outputs: + image-tag: + description: "Built image tag" + value: ${{ jobs.build.outputs.image_tag }} + +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref_name }} +# cancel-in-progress: true + +env: + GCP_PROJECT_NAME: "gd-gcp-rnd-evergreen" + GCP_OIDC_PROVIDER: "projects/945405964360/locations/global/workloadIdentityPools/github/providers/cto-rnd-evergreen-infra" + +jobs: + prepare: + runs-on: ${{ inputs.runner-label }} + outputs: + sha_short: ${{ steps.prepare.outputs.sha_short }} + repo_name: ${{ steps.prepare.outputs.repo_name }} + app_version: ${{ steps.prepare.outputs.version }} + test_folder: ${{ steps.prepare.outputs.test_folder }} + test_type: ${{ steps.prepare.outputs.test_type }} + steps: + - name: "Checkout code" + uses: actions/checkout@v6 + + - name: "Prepare" + id: prepare + shell: bash + run: | + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "repo_name=$(echo ${{ github.repository }} | cut -f2 -d/ )" >> $GITHUB_OUTPUT + echo "version=$(cat ${{ inputs.build-context }}/.version)" >> $GITHUB_OUTPUT + echo "test_folder=$(echo ${{ inputs.run-test }} | cut -f1 -d/ )" >> $GITHUB_OUTPUT + case "${{ inputs.run-test }}" in + *"jest"*) + echo "test_type=jest-junit" >> $GITHUB_OUTPUT + ;; + *"surefire"*) + echo "test_type=java-junit" >> $GITHUB_OUTPUT + ;; + *"trx"*) + echo "test_type=dotnet-trx" >> $GITHUB_OUTPUT + ;; + *) + echo "test_type=unknown" >> $GITHUB_OUTPUT + ;; + esac + + build: + runs-on: ${{ inputs.runner-label }} + needs: [prepare] + outputs: + image_tag: ${{ needs.prepare.outputs.app_version || 0 }}-${{ needs.prepare.outputs.sha_short }} + steps: + - name: "Checkout code" + uses: actions/checkout@v6 + + - name: "Authenticate to GCP via OIDC" + uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # 3.0.0 + id: gcp-auth + with: + workload_identity_provider: ${{ env.GCP_OIDC_PROVIDER }} + service_account: cicd-github-account@${{ env.GCP_PROJECT_NAME }}.iam.gserviceaccount.com + + - name: "Get secrets" + id: get-secret + uses: google-github-actions/get-secretmanager-secrets@bc9c54b29fdffb8a47776820a7d26e77b379d262 # 3.0.0 + with: + secrets: |- + crtoken:${{ env.GCP_PROJECT_NAME }}/evergreen-gcr-rw + + - name: "Setup docker buildx" + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # 4.0.0 + with: + platforms: amd64 + + - name: "Container registry login" + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # 4.1.0 + with: + registry: ${{ inputs.cr-host }} + username: ${{ inputs.cr-login }} + password: ${{ steps.get-secret.outputs.crtoken }} + + # To avoid disk space issues + - name: Free Disk Space + if: ${{ inputs.free-runner-disk-space }} + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + tool-cache: false + docker-images: false + android: true + dotnet: true + haskell: true + swap-storage: true + + - name: "Build and push image" + uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # 7.1.0 + with: + context: ${{ inputs.build-context }} + file: ${{ inputs.dockerfile }} + push: true + tags: | + ${{ inputs.cr-host }}/${{ inputs.image-name }}:${{ needs.prepare.outputs.app_version || 0 }}-${{ needs.prepare.outputs.sha_short }} + build-args: ${{ inputs.build-args }} + target: ${{ inputs.build-target }} + secrets: ${{ secrets.build-secrets }} + + test: + if: ${{ inputs.run-test }} + runs-on: ${{ inputs.runner-label }} + needs: [prepare] + steps: + - name: "Checkout code" + uses: actions/checkout@v6 + + - name: "Setup docker buildx" + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # 4.0.0 + + - name: "Build image" + uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # 7.1.0 + with: + context: ${{ inputs.build-context }} + file: ${{ inputs.dockerfile }} + push: false + tags: | + test:test + target: test + build-args: ${{ inputs.build-args }} + outputs: type=docker + env: + DOCKER_BUILD_SUMMARY: false + DOCKER_BUILD_RECORD_UPLOAD: false + + - name: "Get Tests" + run: | + docker create --name tempc test:test + docker cp tempc:/tmp/evergreen-test ${{ needs.prepare.outputs.test_folder }} + docker rm tempc + + - name: "Save artifacts" + uses: actions/upload-artifact@v7 + with: + name: ${{ needs.prepare.outputs.test_folder }} + path: ${{ inputs.run-test }} + retention-days: 2 + + - name: "Test Report" + uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # 3.0.0 + with: + name: Test report + path: ${{ inputs.run-test }} + reporter: ${{ needs.prepare.outputs.test_type }} diff --git a/.github/workflows/evergreen-deploy.yaml b/.github/workflows/evergreen-deploy.yaml new file mode 100644 index 0000000..4b4bdf9 --- /dev/null +++ b/.github/workflows/evergreen-deploy.yaml @@ -0,0 +1,128 @@ +name: Evergreen Deploy + +on: + workflow_call: + inputs: + argocd-host: + required: false + type: string + description: "ArgoCD hostname" + default: "argocd-prod.evergreen.gcp.griddynamics.net:443" + argocd-version: + required: false + type: string + description: "ArgoCD binary version" + default: "2.14.11" + argocd-app-version: + required: false + type: string + description: "ArgoCD Application version" + default: "0.4" + tenant: + required: true + type: string + description: "Tenant name" + app-name: + required: true + type: string + description: "Application name" + env-name: + required: false + type: string + default: "dev" + description: "Environment name" + set-image-tag: + required: false + type: string + description: "Helm field where image tag is set" + default: "image.tag" + image-tag: + required: false + type: string + description: "Image tag to set" + default: "latest" + chart-version: + required: false + type: string + description: "Helm chart version" + default: "1.10" + destination-cloud: + required: false + type: string + description: "Destination cluster name in ArgoCD" + default: "evergreen-gcp" + runner-label: + required: false + type: string + default: "ubuntu-latest" + description: "Runner name or label where to run" + +env: + GCP_PROJECT_NAME: "gd-gcp-rnd-evergreen" + GCP_OIDC_PROVIDER: "projects/945405964360/locations/global/workloadIdentityPools/github/providers/cto-rnd-evergreen-infra" + +jobs: + deploy: + permissions: + id-token: write + contents: read + runs-on: ${{ inputs.runner-label }} + environment: ${{ inputs.env-name }} + steps: + - name: "Checkout code" + uses: actions/checkout@v5 + + - name: "Authenticate to GCP via OIDC" + uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # 3.0.0 + id: gcp-auth + with: + workload_identity_provider: ${{ env.GCP_OIDC_PROVIDER }} + service_account: cicd-github-account@${{ env.GCP_PROJECT_NAME }}.iam.gserviceaccount.com + + - name: "Get secrets" + id: get-secret + uses: google-github-actions/get-secretmanager-secrets@bc9c54b29fdffb8a47776820a7d26e77b379d262 # 3.0.0 + with: + secrets: |- + atoken:${{ env.GCP_PROJECT_NAME }}/argocd-project-token-${{ inputs.tenant }} + ghtoken:${{ env.GCP_PROJECT_NAME }}/github--gd-evergreen-bot--pat + + - name: "ArgoCD setup" + uses: clowdhaus/argo-cd-action@39d479ab6dd702536e4a20ecc140bffd67cfbee0 # 3.2.0 + with: + version: ${{ inputs.argocd-version }} + command: version + options: --client --short + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "ArgoCD apply" + env: + ARGOCD_SERVER: ${{ inputs.argocd-host }} + ARGOCD_AUTH_TOKEN: ${{ steps.get-secret.outputs.atoken }} + ARGOCD_OPTS: --grpc-web + run: | + APP_NAME="${{ inputs.tenant }}--${{ inputs.app-name }}--${{ inputs.env-name }}" + argocd app set ${APP_NAME} --helm-set ${{ inputs.set-image-tag }}=${{ inputs.image-tag }} --source-position 1 + + - name: "Generate Ingress Summary" + continue-on-error: true + env: + ARGOCD_SERVER: ${{ inputs.argocd-host }} + ARGOCD_AUTH_TOKEN: ${{ steps.get-secret.outputs.atoken }} + ARGOCD_OPTS: --grpc-web + run: | + URLS_JSON=$(argocd app get argocd/${{ inputs.tenant }}--${{ inputs.app-name }}--${{ inputs.env-name }} -o json | jq -c '.status.summary.externalURLs') + + echo "### 🚀 Deployed Ingress URLs" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + if [ "$URLS_JSON" != "null" ] && [ "$URLS_JSON" != "[]" ]; then + echo "| Environment | Link |" >> $GITHUB_STEP_SUMMARY + echo "| :--- | :--- |" >> $GITHUB_STEP_SUMMARY + echo "$URLS_JSON" | jq -r '.[]' | while read -r url; do + echo "| ${{ inputs.env-name }} | [🔗 $url]($url) |" >> $GITHUB_STEP_SUMMARY + done + else + echo "⚠️ No external URLs found for this application." >> $GITHUB_STEP_SUMMARY + fi diff --git a/.github/workflows/evergreen-storybook.yaml b/.github/workflows/evergreen-storybook.yaml index 4d6020d..390856d 100644 --- a/.github/workflows/evergreen-storybook.yaml +++ b/.github/workflows/evergreen-storybook.yaml @@ -33,13 +33,13 @@ jobs: build: needs: test - uses: griddynamics/cto-rnd-evergreen-gha/.github/workflows/evergreen-build.yaml@v3.3 + uses: ./.github/workflows/evergreen-build.yaml with: image-name: gd-gcp-rnd-evergreen/evergreen-v2/gridkit-storybook build-context: './' dockerfile: './Dockerfile.storybook' deploy: - uses: griddynamics/cto-rnd-evergreen-gha/.github/workflows/evergreen-deploy.yaml@v3.3 + uses: ./.github/workflows/evergreen-deploy.yaml needs: build with: tenant: gridkit diff --git a/libs/ui/llms.txt b/libs/ui/llms.txt index 757d251..83d2292 100644 --- a/libs/ui/llms.txt +++ b/libs/ui/llms.txt @@ -84,7 +84,7 @@ Pre-built indexes for quick discovery: > Run `yarn build:ui` to regenerate. Do not edit the block between the markers manually. -66 components total — generated from libs/ui/src/ai/schemas/ on 2026-07-24. +66 components total — generated from libs/ui/src/ai/schemas/ on 2026-09-18. ## Other diff --git a/libs/ui/package.json b/libs/ui/package.json index 2aa1b05..ce05976 100644 --- a/libs/ui/package.json +++ b/libs/ui/package.json @@ -1,6 +1,6 @@ { "name": "gd-design-library", - "version": "1.8.3", + "version": "1.9.1", "license": "MIT", "type": "module", "main": "./index.cjs", @@ -40,7 +40,9 @@ }, "typesVersions": { "*": { - "renderer": ["./utils/a2ui/index.d.ts"] + "renderer": [ + "./utils/a2ui/index.d.ts" + ] } }, "peerDependencies": { diff --git a/libs/ui/src/ai/README.md b/libs/ui/src/ai/README.md index 7d99ac8..27f946d 100644 --- a/libs/ui/src/ai/README.md +++ b/libs/ui/src/ai/README.md @@ -594,7 +594,7 @@ yarn test:ai:watch -_66 components total — generated from `libs/ui/src/ai/schemas/` on 2026-07-24._ +_66 components total — generated from `libs/ui/src/ai/schemas/` on 2026-09-18._ ### Other