From 626d17eebe1615822b3f5ff2fe725c3dd8c705b4 Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Mon, 17 Nov 2025 12:42:38 +0500 Subject: [PATCH] VCST-4281: Update workflows --- .github/workflows/module-ci.yml | 73 ++++++++++++++++++--- .github/workflows/module-release-hotfix.yml | 12 ++-- .github/workflows/publish-nugets.yml | 12 ++-- .github/workflows/release.yml | 6 +- 4 files changed, 80 insertions(+), 23 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 3537d12..c31fc8f 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -1,5 +1,5 @@ -# v3.800.12 -# https://virtocommerce.atlassian.net/browse/VCST-2469 +# v3.800.18 +# https://virtocommerce.atlassian.net/browse/VCST-4078 name: Module CI on: @@ -54,6 +54,8 @@ jobs: moduleId: ${{ steps.artifact_ver.outputs.moduleId }} matrix: ${{ steps.deployment-matrix.outputs.matrix }} run-e2e: ${{ steps.run-e2e.outputs.result }} + run-ui-tests: ${{ steps.run-ui-tests.outputs.result }} + deployment-folder-exists: ${{ steps.check_deployment_folder.outputs.exists }} steps: @@ -91,6 +93,17 @@ jobs: uses: VirtoCommerce/vc-github-actions/get-image-version@master id: artifact_ver + - name: Check if .deployment folder exists + id: check_deployment_folder + run: | + if [ -d ".deployment" ]; then + echo "exists=true" >> $GITHUB_OUTPUT + echo "Diagnostic: .deployment folder exists." + else + echo "exists=false" >> $GITHUB_OUTPUT + echo "Diagnostic: .deployment folder does NOT exist." + fi + - name: Set VERSION_SUFFIX variable run: | if [ '${{ github.event_name }}' = 'workflow_dispatch' ]; then @@ -98,6 +111,7 @@ jobs: else echo "VERSION_SUFFIX=${{ steps.artifact_ver.outputs.suffix }}" >> $GITHUB_ENV fi; + - name: Add version suffix if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }} uses: VirtoCommerce/vc-github-actions/add-version-suffix@master @@ -183,14 +197,37 @@ jobs: - name: Check commit message for version number id: run-e2e + env: + COMMIT_MESSAGE: ${{ github.event.head_commit.message }} run: | - if [[ "${{ github.event.head_commit.message }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; + if [[ "$COMMIT_MESSAGE" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "result=false" >> $GITHUB_OUTPUT else echo "result=true" >> $GITHUB_OUTPUT fi + - name: Look for xapi module in dependencies + id: run-ui-tests + shell: pwsh + run: | + $manifestFile = Get-ChildItem -Path ${{ github.workspace }} -Recurse -Filter "module.manifest" | Where-Object { $_.FullName -like "*/src/*/module.manifest" } | Select-Object -First 1 + if (-not $manifestFile) { + Write-Error "No module.manifest file found in src subdirectories" + exit 1 + } + Write-Host "Found module.manifest at: $($manifestFile.FullName)" + $manifestContent = Get-Content $manifestFile.FullName -Raw + $containsXapi = 'false' + $dependecies = $(Select-Xml -Content $manifestContent -XPath "//dependencies").Node.dependency + foreach ($dependency in $dependecies) { + if ($dependency.id -eq 'VirtoCommerce.Xapi') { + Write-Host "Found VirtoCommerce.Xapi in dependencies" + $containsXapi = 'true' + } + } + echo "result=$containsXapi" >> $env:GITHUB_OUTPUT + - name: Setup Git Credentials if: ${{ (github.ref == 'refs/heads/dev' && github.event_name != 'workflow_dispatch') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@master @@ -237,17 +274,33 @@ jobs: run: | echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" + ui-auto-tests: + if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push')) || + (github.event_name == 'workflow_dispatch') || ((github.base_ref == 'dev') && (github.event_name == 'pull_request')) }} + needs: 'ci' + uses: VirtoCommerce/.github/.github/workflows/ui-autotests.yml@v3.800.18 + with: + installModules: 'false' + installCustomModule: 'true' + customModuleId: ${{ needs.ci.outputs.moduleId }} + customModuleUrl: ${{ needs.ci.outputs.artifactUrl }} + runTests: ${{ needs.ci.outputs.run-ui-tests }} + vctestingRepoBranch: 'dev' + frontendZipUrl: 'latest' + secrets: + envPAT: ${{ secrets.REPO_TOKEN }} + testSecretEnvFile: ${{ secrets.VC_TESTING_MODULE_ENV_FILE }} + module-katalon-tests: if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch') || (github.base_ref == 'dev') && (github.event_name == 'pull_request') }} needs: 'ci' - uses: VirtoCommerce/.github/.github/workflows/e2e.yml@v3.800.12 - + uses: VirtoCommerce/.github/.github/workflows/e2e.yml@v3.800.18 with: katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon' katalonRepoBranch: 'dev' testSuite: 'Test Suites/Modules/Platform_collection' - installModules: 'true' + installModules: 'false' installCustomModule: 'true' customModuleId: ${{ needs.ci.outputs.moduleId }} customModuleUrl: ${{ needs.ci.outputs.artifactUrl }} @@ -258,9 +311,11 @@ jobs: katalonApiKey: ${{ secrets.KATALON_API_KEY }} deploy-cloud: - if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} + if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') + && github.event_name == 'push' + && needs.ci.outputs.deployment-folder-exists == 'true'}} needs: ci - uses: VirtoCommerce/.github/.github/workflows/deploy-cloud.yml@v3.800.12 + uses: VirtoCommerce/.github/.github/workflows/deploy-cloud.yml@v3.800.18 with: releaseSource: module moduleId: ${{ needs.ci.outputs.moduleId }} @@ -269,4 +324,4 @@ jobs: jiraKeys: ${{ needs.ci.outputs.jira-keys }} argoServer: 'argo.virtocommerce.cloud' matrix: '{"include":${{ needs.ci.outputs.matrix }}}' - secrets: inherit + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/module-release-hotfix.yml b/.github/workflows/module-release-hotfix.yml index 444091c..773ab28 100644 --- a/.github/workflows/module-release-hotfix.yml +++ b/.github/workflows/module-release-hotfix.yml @@ -1,5 +1,5 @@ -# v3.800.12 -# https://virtocommerce.atlassian.net/browse/VCST-2469 +# v3.800.18 +# https://virtocommerce.atlassian.net/browse/VCST-4078 name: Release hotfix on: @@ -13,12 +13,12 @@ on: jobs: test: - uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.12 + uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.18 secrets: sonarToken: ${{ secrets.SONAR_TOKEN }} build: - uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.12 + uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.18 with: uploadPackage: 'true' uploadDocker: 'false' @@ -46,7 +46,7 @@ jobs: publish-github-release: needs: [build, test, get-metadata] - uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.12 + uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.18 with: fullKey: ${{ needs.build.outputs.packageFullKey }} changeLog: '${{ needs.get-metadata.outputs.changeLog }}' @@ -79,4 +79,4 @@ jobs: vc-build IncrementPatch git add Directory.Build.props *module.manifest git commit -m "ci: Auto IncrementPatch" - git push + git push \ No newline at end of file diff --git a/.github/workflows/publish-nugets.yml b/.github/workflows/publish-nugets.yml index f07933d..204c80e 100644 --- a/.github/workflows/publish-nugets.yml +++ b/.github/workflows/publish-nugets.yml @@ -1,5 +1,5 @@ -# v3.800.12 -# https://virtocommerce.atlassian.net/browse/VCST-2469 +# v3.800.18 +# https://virtocommerce.atlassian.net/browse/VCST-4078 name: Publish nuget on: @@ -13,12 +13,12 @@ on: jobs: test: - uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.12 + uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.18 secrets: sonarToken: ${{ secrets.SONAR_TOKEN }} build: - uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.12 + uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.18 with: uploadPackage: 'true' uploadDocker: 'false' @@ -29,10 +29,12 @@ jobs: publish-nuget: needs: [build, test] - uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.12 + uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.18 with: fullKey: ${{ needs.build.outputs.packageFullKey }} forceGithub: false + forceBlob: true secrets: envPAT: ${{ secrets.GITHUB_TOKEN }} nugetKey: ${{ secrets.NUGET_KEY }} + BLOB_TOKEN: ${{ secrets.BLOB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 19c5caf..e09c82f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ -# v3.800.12 -# https://virtocommerce.atlassian.net/browse/VCST-2469 +# v3.800.18 +# https://virtocommerce.atlassian.net/browse/VCST-4078 name: Release on: @@ -7,6 +7,6 @@ on: jobs: release: - uses: VirtoCommerce/.github/.github/workflows/release.yml@v3.800.12 + uses: VirtoCommerce/.github/.github/workflows/release.yml@v3.800.18 secrets: envPAT: ${{ secrets.REPO_TOKEN }} \ No newline at end of file