From ef2d1352191f08cde2b577451f1f4e7d08cdfbba Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:47:26 +0500 Subject: [PATCH 01/36] Empty commit for test --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 12c8cad..1cd721a 100644 --- a/README.md +++ b/README.md @@ -54,3 +54,5 @@ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + + From c6279e8e5d0af77077fdf24df2dfd592ffc3921c Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:59:37 +0500 Subject: [PATCH 02/36] Empty commit --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 1cd721a..12c8cad 100644 --- a/README.md +++ b/README.md @@ -54,5 +54,3 @@ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - - From 0eff679c965a96ad07c8fc03dac0dad33dfca3fe Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Fri, 20 Sep 2024 16:46:30 +0500 Subject: [PATCH 03/36] Use branch for workflow test --- .github/workflows/module-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index d52007c..4128247 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -241,7 +241,7 @@ jobs: if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch')}} needs: 'ci' - uses: VirtoCommerce/.github/.github/workflows/e2e.yml@v3.800.9 + uses: VirtoCommerce/.github/.github/workflows/e2e.yml@vVCST-1738 with: katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon' From a2821afa161fba307f2c92ce7ef624b1bf51e5ce Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Fri, 20 Sep 2024 16:57:30 +0500 Subject: [PATCH 04/36] Fix typo --- .github/workflows/module-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 4128247..2b9b8be 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -241,7 +241,7 @@ jobs: if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch')}} needs: 'ci' - uses: VirtoCommerce/.github/.github/workflows/e2e.yml@vVCST-1738 + uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 with: katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon' From a22f17e7418abe849b12a3c524a21bcc1c4b3eed Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:26:24 +0500 Subject: [PATCH 05/36] VCST-17 --- .github/workflows/module-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 2b9b8be..d732388 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -256,6 +256,9 @@ jobs: secrets: envPAT: ${{ secrets.REPO_TOKEN }} katalonApiKey: ${{ secrets.KATALON_API_KEY }} + steps: + - name: Check test results + run: echo "Test results from reusable workflow: ${{ needs.module-katalon-tests.outputs.tests-result }}" deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} From 10989b676138d61825f79fd295058b6874833de0 Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:27:28 +0500 Subject: [PATCH 06/36] VCST-1738: Revert changes --- .github/workflows/module-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index d732388..2b9b8be 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -256,9 +256,6 @@ jobs: secrets: envPAT: ${{ secrets.REPO_TOKEN }} katalonApiKey: ${{ secrets.KATALON_API_KEY }} - steps: - - name: Check test results - run: echo "Test results from reusable workflow: ${{ needs.module-katalon-tests.outputs.tests-result }}" deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} From d43e888b21999c83986cee945516a2db9e5b0508 Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:12:10 +0500 Subject: [PATCH 07/36] VCST-1738: Get called workflow output --- .github/workflows/module-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 2b9b8be..1180ed2 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -242,7 +242,6 @@ jobs: (github.event_name == 'workflow_dispatch')}} needs: 'ci' uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 - with: katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon' katalonRepoBranch: 'dev' @@ -256,7 +255,10 @@ jobs: secrets: envPAT: ${{ secrets.REPO_TOKEN }} katalonApiKey: ${{ secrets.KATALON_API_KEY }} - + steps: + - name: Check test status + run: echo "Test status: ${{ needs.module-katalon-tests.outputs.status }}" + deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} needs: ci From e093bf355b72f51c2009b85212b969cad0e92dd6 Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:54:54 +0500 Subject: [PATCH 08/36] VCST-1738: Fix output reference --- .github/workflows/module-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 1180ed2..4c9bd68 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -257,7 +257,7 @@ jobs: katalonApiKey: ${{ secrets.KATALON_API_KEY }} steps: - name: Check test status - run: echo "Test status: ${{ needs.module-katalon-tests.outputs.status }}" + run: echo "Test status: ${{ jobs.module-katalon-tests.outputs.tests-result }}" deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} From 1d2a56c7639cc38745ce6a5bd5147caafa3ef08b Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:09:04 +0500 Subject: [PATCH 09/36] VCST-1738: Add extra job to get status --- .github/workflows/module-ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 4c9bd68..f7013bc 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -255,9 +255,13 @@ jobs: secrets: envPAT: ${{ secrets.REPO_TOKEN }} katalonApiKey: ${{ secrets.KATALON_API_KEY }} - steps: - - name: Check test status - run: echo "Test status: ${{ jobs.module-katalon-tests.outputs.tests-result }}" + + check-tests-status: + runs-on: ubuntu-latest + needs: module-katalon-tests # This indicates that the `check-status` job runs after `module-katalon-tests` + steps: + - name: Check test status + run: echo "Test status: ${{ needs.module-katalon-tests.outputs.test-status }}" deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} From 305dfcf65c6cd4c191dccedc0feead67b91efc51 Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:13:22 +0500 Subject: [PATCH 10/36] VCST-1738: Fix indentation --- .github/workflows/module-ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index f7013bc..321602b 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -257,11 +257,10 @@ jobs: katalonApiKey: ${{ secrets.KATALON_API_KEY }} check-tests-status: - runs-on: ubuntu-latest - needs: module-katalon-tests # This indicates that the `check-status` job runs after `module-katalon-tests` - steps: - - name: Check test status - run: echo "Test status: ${{ needs.module-katalon-tests.outputs.test-status }}" + needs: 'module-katalon-tests' # This indicates that the `check-status` job runs after `module-katalon-tests` + steps: + - name: Check test status + run: echo "Test status: ${{ needs.module-katalon-tests.outputs.test-status }}" deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} From 92311fe628d4cdf5a451be080e6192d0d2585c7b Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:24:11 +0500 Subject: [PATCH 11/36] VCST-1738: Fix syntax --- .github/workflows/module-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 321602b..20f2044 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -257,10 +257,12 @@ jobs: katalonApiKey: ${{ secrets.KATALON_API_KEY }} check-tests-status: + runs-on: ubuntu-latest needs: 'module-katalon-tests' # This indicates that the `check-status` job runs after `module-katalon-tests` steps: - - name: Check test status - run: echo "Test status: ${{ needs.module-katalon-tests.outputs.test-status }}" + - name: Check test status + run: | + echo "Test status: ${{ needs.module-katalon-tests.outputs.test-status }}" deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} From 316d496d74c792fe33a09d0f58a3e931f571c822 Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:49:36 +0500 Subject: [PATCH 12/36] VCST-1738: Try an API to report status --- .github/workflows/module-ci.yml | 37 +++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 20f2044..62821fc 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -260,10 +260,39 @@ jobs: runs-on: ubuntu-latest needs: 'module-katalon-tests' # This indicates that the `check-status` job runs after `module-katalon-tests` steps: - - name: Check test status - run: | - echo "Test status: ${{ needs.module-katalon-tests.outputs.test-status }}" - + - name: get sha from PR number and save output + id: get-sha + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + console.log('PR number: ' + ${{ github.event.issue.number }}) + const pr = await github.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: ${{ github.event.issue.number }} + }) + console.log('PR Head sha: ' + pr.data.head.sha) + core.setOutput('sha', pr.data.head.sha) + - name: Report check + # if: ${{ github.event.inputs.used-branch && steps.module-katalon-tests.outcome }} + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.checks.create({ + name: 'run tests', + head_sha: '${{ github.event.issue.pull_request.head.sha }}', + status: 'completed', + conclusion: '${{ steps.module-katalon-tests.outcome }}', + output: { + title: 'Run tests', + summary: 'Results: ${{ steps.module-katalon-tests.outcome }}' + }, + owner: context.repo.owner, + repo: context.repo.repo + }) deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} needs: ci From 518a3ae8c97874bec7133465a35f7f0e74676716 Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:10:18 +0500 Subject: [PATCH 13/36] VCST-1738: Use v7 for gh script --- .github/workflows/module-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 62821fc..80e47c6 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -262,7 +262,7 @@ jobs: steps: - name: get sha from PR number and save output id: get-sha - uses: actions/github-script@v3 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -277,7 +277,7 @@ jobs: - name: Report check # if: ${{ github.event.inputs.used-branch && steps.module-katalon-tests.outcome }} if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/github-script@v3 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | From 3a311c98d4666d5e30c7c9ebedb302727edf5b13 Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:11:35 +0500 Subject: [PATCH 14/36] VCST-1738: Temporary disable payload --- .github/workflows/module-ci.yml | 312 ++++++++++++++++---------------- 1 file changed, 156 insertions(+), 156 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 80e47c6..ba7687f 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -46,14 +46,14 @@ jobs: BUILD_STATE: 'failed' RELEASE_STATUS: 'false' - outputs: - artifactUrl: ${{ steps.artifactUrl.outputs.download_url }} - blobId: ${{ steps.blobRelease.outputs.blobId }} - jira-keys: ${{ steps.jira_keys.outputs.jira-keys }} - version: ${{ steps.artifact_ver.outputs.shortVersion }} - moduleId: ${{ steps.artifact_ver.outputs.moduleId }} - matrix: ${{ steps.deployment-matrix.outputs.matrix }} - run-e2e: ${{ steps.run-e2e.outputs.result }} + # outputs: + # artifactUrl: ${{ steps.artifactUrl.outputs.download_url }} + # blobId: ${{ steps.blobRelease.outputs.blobId }} + # jira-keys: ${{ steps.jira_keys.outputs.jira-keys }} + # version: ${{ steps.artifact_ver.outputs.shortVersion }} + # moduleId: ${{ steps.artifact_ver.outputs.moduleId }} + # matrix: ${{ steps.deployment-matrix.outputs.matrix }} + # run-e2e: ${{ steps.run-e2e.outputs.result }} steps: @@ -62,180 +62,180 @@ jobs: with: node-version: '20' - - name: Set up Java 17 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' + # - name: Set up Java 17 + # uses: actions/setup-java@v4 + # with: + # distribution: 'temurin' + # java-version: '17' - - name: Set RELEASE_STATUS - if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.event_name == 'push' }} - run: | - echo "RELEASE_STATUS=true" >> $GITHUB_ENV + # - name: Set RELEASE_STATUS + # if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.event_name == 'push' }} + # run: | + # echo "RELEASE_STATUS=true" >> $GITHUB_ENV - - uses: actions/checkout@v4 - with: - fetch-depth: 0 + # - uses: actions/checkout@v4 + # with: + # fetch-depth: 0 - - name: Install VirtoCommerce.GlobalTool - uses: VirtoCommerce/vc-github-actions/setup-vcbuild@master + # - name: Install VirtoCommerce.GlobalTool + # uses: VirtoCommerce/vc-github-actions/setup-vcbuild@master - - name: Install dotnet-sonarscanner - run: dotnet tool install --global dotnet-sonarscanner + # - name: Install dotnet-sonarscanner + # run: dotnet tool install --global dotnet-sonarscanner - - name: Get Changelog - id: changelog - uses: VirtoCommerce/vc-github-actions/changelog-generator@master + # - name: Get Changelog + # id: changelog + # uses: VirtoCommerce/vc-github-actions/changelog-generator@master - - name: Get Artifact Version - uses: VirtoCommerce/vc-github-actions/get-image-version@master - id: artifact_ver + # - name: Get Artifact Version + # uses: VirtoCommerce/vc-github-actions/get-image-version@master + # id: artifact_ver - - name: Set VERSION_SUFFIX variable - run: | - if [ '${{ github.event_name }}' = 'workflow_dispatch' ]; then - echo "VERSION_SUFFIX=${{ steps.artifact_ver.outputs.fullSuffix }}" >> $GITHUB_ENV - 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 - with: - versionSuffix: ${{ env.VERSION_SUFFIX }} + # - name: Set VERSION_SUFFIX variable + # run: | + # if [ '${{ github.event_name }}' = 'workflow_dispatch' ]; then + # echo "VERSION_SUFFIX=${{ steps.artifact_ver.outputs.fullSuffix }}" >> $GITHUB_ENV + # 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 + # with: + # versionSuffix: ${{ env.VERSION_SUFFIX }} - - name: SonarCloud Begin - uses: VirtoCommerce/vc-github-actions/sonar-scanner-begin@master - with: - repoOrg: ${{ github.repository_owner }} - sonarOrg: ${{secrets.SONAR_ORG_KEY}} + # - name: SonarCloud Begin + # uses: VirtoCommerce/vc-github-actions/sonar-scanner-begin@master + # with: + # repoOrg: ${{ github.repository_owner }} + # sonarOrg: ${{secrets.SONAR_ORG_KEY}} - - name: Build - run: vc-build Compile + # - name: Build + # run: vc-build Compile - - name: Unit Tests - run: vc-build Test -skip + # - name: Unit Tests + # run: vc-build Test -skip - - name: SonarCloud End - uses: VirtoCommerce/vc-github-actions/sonar-scanner-end@master + # - name: SonarCloud End + # uses: VirtoCommerce/vc-github-actions/sonar-scanner-end@master - - name: Quality Gate - uses: VirtoCommerce/vc-github-actions/sonar-quality-gate@master - with: - login: ${{secrets.SONAR_TOKEN}} + # - name: Quality Gate + # uses: VirtoCommerce/vc-github-actions/sonar-quality-gate@master + # with: + # login: ${{secrets.SONAR_TOKEN}} - - name: Packaging - run: vc-build Compress -skip Clean+Restore+Compile+Test + # - name: Packaging + # run: vc-build Compress -skip Clean+Restore+Compile+Test - - name: Publish Nuget - if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} - uses: VirtoCommerce/vc-github-actions/publish-nuget@master + # - name: Publish Nuget + # if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} + # uses: VirtoCommerce/vc-github-actions/publish-nuget@master - - name: Publish to Blob - if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main') }} - id: blobRelease - uses: VirtoCommerce/vc-github-actions/publish-blob-release@master - with: - blobSAS: ${{ secrets.BLOB_TOKEN }} - blobUrl: ${{ vars.BLOB_URL }} + # - name: Publish to Blob + # if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main') }} + # id: blobRelease + # uses: VirtoCommerce/vc-github-actions/publish-blob-release@master + # with: + # blobSAS: ${{ secrets.BLOB_TOKEN }} + # blobUrl: ${{ vars.BLOB_URL }} - - name: Add Jira link - if: ${{ github.event_name == 'pull_request' }} - uses: VirtoCommerce/vc-github-actions/publish-jira-link@master - with: - branchName: ${{ github.head_ref }} - repoOrg: ${{ github.repository_owner }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Add Jira link + # if: ${{ github.event_name == 'pull_request' }} + # uses: VirtoCommerce/vc-github-actions/publish-jira-link@master + # with: + # branchName: ${{ github.head_ref }} + # repoOrg: ${{ github.repository_owner }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Add link to PR - if: ${{ github.event_name == 'pull_request' }} - uses: VirtoCommerce/vc-github-actions/publish-artifact-link@master - with: - artifactUrl: ${{ steps.blobRelease.outputs.packageUrl }} - repoOrg: ${{ github.repository_owner }} - downloadComment: 'Artifact URL:' + # - name: Add link to PR + # if: ${{ github.event_name == 'pull_request' }} + # uses: VirtoCommerce/vc-github-actions/publish-artifact-link@master + # with: + # artifactUrl: ${{ steps.blobRelease.outputs.packageUrl }} + # repoOrg: ${{ github.repository_owner }} + # downloadComment: 'Artifact URL:' - - name: Publish Github Release - if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} - id: githubRelease - with: - changelog: ${{ steps.changelog.outputs.changelog }} - organization: ${{ github.repository_owner }} - uses: VirtoCommerce/vc-github-actions/publish-github-release@master + # - name: Publish Github Release + # if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} + # id: githubRelease + # with: + # changelog: ${{ steps.changelog.outputs.changelog }} + # organization: ${{ github.repository_owner }} + # uses: VirtoCommerce/vc-github-actions/publish-github-release@master - - name: Set artifactUrl value - id: artifactUrl - run: | - if [ '${{ github.ref }}' = 'refs/heads/master' ] || [ '${{ github.ref }}' = 'refs/heads/main' ]; then - echo "download_url=${{ steps.githubRelease.outputs.downloadUrl }}" >> $GITHUB_OUTPUT - else - echo "download_url=${{ steps.blobRelease.outputs.packageUrl }}" >> $GITHUB_OUTPUT - fi; + # - name: Set artifactUrl value + # id: artifactUrl + # run: | + # if [ '${{ github.ref }}' = 'refs/heads/master' ] || [ '${{ github.ref }}' = 'refs/heads/main' ]; then + # echo "download_url=${{ steps.githubRelease.outputs.downloadUrl }}" >> $GITHUB_OUTPUT + # else + # echo "download_url=${{ steps.blobRelease.outputs.packageUrl }}" >> $GITHUB_OUTPUT + # fi; - - name: Create deployment matrix - if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} - uses: VirtoCommerce/vc-github-actions/cloud-create-deploy-matrix@master - id: deployment-matrix - with: - deployConfigPath: '.deployment/module/cloudDeploy.json' - releaseBranch: 'master' + # - name: Create deployment matrix + # if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} + # uses: VirtoCommerce/vc-github-actions/cloud-create-deploy-matrix@master + # id: deployment-matrix + # with: + # deployConfigPath: '.deployment/module/cloudDeploy.json' + # releaseBranch: 'master' - - name: Check commit message for version number - id: run-e2e - run: | - if [[ "${{ github.event.head_commit.message }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; - then - echo "result=false" >> $GITHUB_OUTPUT - else - echo "result=true" >> $GITHUB_OUTPUT - fi + # - name: Check commit message for version number + # id: run-e2e + # run: | + # if [[ "${{ github.event.head_commit.message }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; + # then + # echo "result=false" >> $GITHUB_OUTPUT + # else + # echo "result=true" >> $GITHUB_OUTPUT + # fi - - 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 - with: - githubToken: ${{ secrets.REPO_TOKEN }} + # - 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 + # with: + # githubToken: ${{ secrets.REPO_TOKEN }} - - name: Publish Manifest - 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/publish-manifest@master - with: - packageUrl: ${{ steps.artifactUrl.outputs.download_url }} + # - name: Publish Manifest + # 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/publish-manifest@master + # with: + # packageUrl: ${{ steps.artifactUrl.outputs.download_url }} - - name: Parse Jira Keys from All Commits - uses: VirtoCommerce/vc-github-actions/get-jira-keys@master - if: always() - id: jira_keys - with: - release: ${{ env.RELEASE_STATUS }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Parse Jira Keys from All Commits + # uses: VirtoCommerce/vc-github-actions/get-jira-keys@master + # if: always() + # id: jira_keys + # with: + # release: ${{ env.RELEASE_STATUS }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Push Build Info to Jira - if: ${{ env.CLOUD_INSTANCE_BASE_URL != 0 && env.CLIENT_ID != 0 && env.CLIENT_SECRET != 0 && steps.jira_keys.outputs.jira-keys != '' && always() }} - id: push_build_info_to_jira - uses: VirtoCommerce/jira-upload-build-info@master - with: - cloud-instance-base-url: '${{ secrets.CLOUD_INSTANCE_BASE_URL }}' - client-id: '${{ secrets.CLIENT_ID }}' - client-secret: '${{ secrets.CLIENT_SECRET }}' - pipeline-id: '${{ github.repository }} ${{ github.workflow }}' - build-number: ${{ github.run_number }} - build-display-name: 'Workflow: ${{ github.workflow }} (#${{ github.run_number }})' - build-state: '${{ env.BUILD_STATE }}' - build-url: '${{github.event.repository.url}}/actions/runs/${{github.run_id}}' - update-sequence-number: '${{ github.run_id }}' - last-updated: '${{github.event.head_commit.timestamp}}' - issue-keys: '${{ steps.jira_keys.outputs.jira-keys }}' - commit-id: '${{ github.sha }}' - repo-url: '${{ github.event.repository.url }}' - build-ref-url: '${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}' + # - name: Push Build Info to Jira + # if: ${{ env.CLOUD_INSTANCE_BASE_URL != 0 && env.CLIENT_ID != 0 && env.CLIENT_SECRET != 0 && steps.jira_keys.outputs.jira-keys != '' && always() }} + # id: push_build_info_to_jira + # uses: VirtoCommerce/jira-upload-build-info@master + # with: + # cloud-instance-base-url: '${{ secrets.CLOUD_INSTANCE_BASE_URL }}' + # client-id: '${{ secrets.CLIENT_ID }}' + # client-secret: '${{ secrets.CLIENT_SECRET }}' + # pipeline-id: '${{ github.repository }} ${{ github.workflow }}' + # build-number: ${{ github.run_number }} + # build-display-name: 'Workflow: ${{ github.workflow }} (#${{ github.run_number }})' + # build-state: '${{ env.BUILD_STATE }}' + # build-url: '${{github.event.repository.url}}/actions/runs/${{github.run_id}}' + # update-sequence-number: '${{ github.run_id }}' + # last-updated: '${{github.event.head_commit.timestamp}}' + # issue-keys: '${{ steps.jira_keys.outputs.jira-keys }}' + # commit-id: '${{ github.sha }}' + # repo-url: '${{ github.event.repository.url }}' + # build-ref-url: '${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}' - - name: Confirm Jira Build Output - if: success() - run: | - echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" + # - name: Confirm Jira Build Output + # if: success() + # run: | + # echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" module-katalon-tests: if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || From 70603fa120cfd33b7977c74aaf675cec392bd41c Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 08:32:29 +0500 Subject: [PATCH 15/36] VCST-1738: Check commit sha variable --- .github/workflows/module-ci.yml | 51 ++++++++++++++------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index ba7687f..aa1bd72 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -238,42 +238,33 @@ jobs: # echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" module-katalon-tests: - if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || - (github.event_name == 'workflow_dispatch')}} - needs: 'ci' - uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 - with: - katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon' - katalonRepoBranch: 'dev' - testSuite: 'Test Suites/Modules/Platform_collection' - installModules: 'true' - installCustomModule: 'true' - customModuleId: ${{ needs.ci.outputs.moduleId }} - customModuleUrl: ${{ needs.ci.outputs.artifactUrl }} - platformDockerTag: 'dev-linux-latest' - storefrontDockerTag: 'dev-linux-latest' - secrets: - envPAT: ${{ secrets.REPO_TOKEN }} - katalonApiKey: ${{ secrets.KATALON_API_KEY }} + # if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || + # (github.event_name == 'workflow_dispatch')}} + # needs: 'ci' + # uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 + # with: + # katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon' + # katalonRepoBranch: 'dev' + # testSuite: 'Test Suites/Modules/Platform_collection' + # installModules: 'true' + # installCustomModule: 'true' + # customModuleId: ${{ needs.ci.outputs.moduleId }} + # customModuleUrl: ${{ needs.ci.outputs.artifactUrl }} + # platformDockerTag: 'dev-linux-latest' + # storefrontDockerTag: 'dev-linux-latest' + # secrets: + # envPAT: ${{ secrets.REPO_TOKEN }} + # katalonApiKey: ${{ secrets.KATALON_API_KEY }} check-tests-status: runs-on: ubuntu-latest - needs: 'module-katalon-tests' # This indicates that the `check-status` job runs after `module-katalon-tests` + # needs: 'module-katalon-tests' # This indicates that the `check-status` job runs after `module-katalon-tests` steps: - name: get sha from PR number and save output id: get-sha - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - console.log('PR number: ' + ${{ github.event.issue.number }}) - const pr = await github.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: ${{ github.event.issue.number }} - }) - console.log('PR Head sha: ' + pr.data.head.sha) - core.setOutput('sha', pr.data.head.sha) + run: | + $r = Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.REPO_TOKEN }}"; "Accept" = "application/vnd.github.v3+json"; "X-GitHub-Api-Version" = "2022-11-28" } -Uri https://api.github.com/repos/VirtoCommerce/vc-module-subscription/commits/${{ github.GITHUB_SHA }}/pulls | convertFrom-Json + $r - name: Report check # if: ${{ github.event.inputs.used-branch && steps.module-katalon-tests.outcome }} if: ${{ github.event_name == 'workflow_dispatch' }} From bbf0f78391f676fab0ac8b3055b01a32c73b37b7 Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 08:33:42 +0500 Subject: [PATCH 16/36] VCST-1738: Enable tests step --- .github/workflows/module-ci.yml | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index aa1bd72..2ef3514 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -238,27 +238,27 @@ jobs: # echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" module-katalon-tests: - # if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || - # (github.event_name == 'workflow_dispatch')}} - # needs: 'ci' - # uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 - # with: - # katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon' - # katalonRepoBranch: 'dev' - # testSuite: 'Test Suites/Modules/Platform_collection' - # installModules: 'true' - # installCustomModule: 'true' - # customModuleId: ${{ needs.ci.outputs.moduleId }} - # customModuleUrl: ${{ needs.ci.outputs.artifactUrl }} - # platformDockerTag: 'dev-linux-latest' - # storefrontDockerTag: 'dev-linux-latest' - # secrets: - # envPAT: ${{ secrets.REPO_TOKEN }} - # katalonApiKey: ${{ secrets.KATALON_API_KEY }} + if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || + (github.event_name == 'workflow_dispatch')}} + needs: 'ci' + uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 + with: + katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon' + katalonRepoBranch: 'dev' + testSuite: 'Test Suites/Modules/Platform_collection' + installModules: 'true' + installCustomModule: 'true' + customModuleId: ${{ needs.ci.outputs.moduleId }} + customModuleUrl: ${{ needs.ci.outputs.artifactUrl }} + platformDockerTag: 'dev-linux-latest' + storefrontDockerTag: 'dev-linux-latest' + secrets: + envPAT: ${{ secrets.REPO_TOKEN }} + katalonApiKey: ${{ secrets.KATALON_API_KEY }} check-tests-status: runs-on: ubuntu-latest - # needs: 'module-katalon-tests' # This indicates that the `check-status` job runs after `module-katalon-tests` + needs: 'module-katalon-tests' # This indicates that the `check-status` job runs after `module-katalon-tests` steps: - name: get sha from PR number and save output id: get-sha From 4db20b3fa97e15a5ce02cd07213414381011a93f Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 08:38:04 +0500 Subject: [PATCH 17/36] VCST-1738: Fix GITHUB_SHA syntax --- .github/workflows/module-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 2ef3514..07769b5 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -263,7 +263,7 @@ jobs: - name: get sha from PR number and save output id: get-sha run: | - $r = Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.REPO_TOKEN }}"; "Accept" = "application/vnd.github.v3+json"; "X-GitHub-Api-Version" = "2022-11-28" } -Uri https://api.github.com/repos/VirtoCommerce/vc-module-subscription/commits/${{ github.GITHUB_SHA }}/pulls | convertFrom-Json + $r = Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.REPO_TOKEN }}"; "Accept" = "application/vnd.github.v3+json"; "X-GitHub-Api-Version" = "2022-11-28" } -Uri https://api.github.com/repos/VirtoCommerce/vc-module-subscription/commits/${{ github.SHA }}/pulls | convertFrom-Json $r - name: Report check # if: ${{ github.event.inputs.used-branch && steps.module-katalon-tests.outcome }} From 0aee22de6376bf3cb1bd6e9a2df911e4a8c0b6fe Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 08:43:29 +0500 Subject: [PATCH 18/36] VCST-1738: Remove triger --- .github/workflows/module-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 07769b5..1050299 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -20,6 +20,7 @@ on: branches: [master, main, dev] paths-ignore: + - '.github/**' - 'docs/**' - 'build/**' - 'README.md' @@ -258,10 +259,11 @@ jobs: check-tests-status: runs-on: ubuntu-latest - needs: 'module-katalon-tests' # This indicates that the `check-status` job runs after `module-katalon-tests` + needs: 'module-katalon-tests' steps: - name: get sha from PR number and save output id: get-sha + shell: pwsh run: | $r = Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.REPO_TOKEN }}"; "Accept" = "application/vnd.github.v3+json"; "X-GitHub-Api-Version" = "2022-11-28" } -Uri https://api.github.com/repos/VirtoCommerce/vc-module-subscription/commits/${{ github.SHA }}/pulls | convertFrom-Json $r From 9cc45584707012d3335a1ce204d4ae0c5438f298 Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 08:58:54 +0500 Subject: [PATCH 19/36] VCST-1738: Use env variable --- .github/workflows/module-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 1050299..ad105a5 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -266,7 +266,7 @@ jobs: shell: pwsh run: | $r = Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.REPO_TOKEN }}"; "Accept" = "application/vnd.github.v3+json"; "X-GitHub-Api-Version" = "2022-11-28" } -Uri https://api.github.com/repos/VirtoCommerce/vc-module-subscription/commits/${{ github.SHA }}/pulls | convertFrom-Json - $r + echo "merge_commit_sha=$($r.merge_commit_sha)" >> GITHUB_ENV - name: Report check # if: ${{ github.event.inputs.used-branch && steps.module-katalon-tests.outcome }} if: ${{ github.event_name == 'workflow_dispatch' }} @@ -276,7 +276,7 @@ jobs: script: | github.checks.create({ name: 'run tests', - head_sha: '${{ github.event.issue.pull_request.head.sha }}', + head_sha: '${{ env.merge_commit_sha }}', status: 'completed', conclusion: '${{ steps.module-katalon-tests.outcome }}', output: { From 10652eaaced0b92be7308626993bda31f7682b03 Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 10:43:23 +0500 Subject: [PATCH 20/36] VCST-1738: Reformat check step --- .github/workflows/module-ci.yml | 48 ++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index ad105a5..6b6835a 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -239,8 +239,7 @@ jobs: # echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" module-katalon-tests: - if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || - (github.event_name == 'workflow_dispatch')}} + if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch')}} needs: 'ci' uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 with: @@ -261,31 +260,56 @@ jobs: runs-on: ubuntu-latest needs: 'module-katalon-tests' steps: - - name: get sha from PR number and save output + - name: get sha id: get-sha shell: pwsh run: | $r = Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.REPO_TOKEN }}"; "Accept" = "application/vnd.github.v3+json"; "X-GitHub-Api-Version" = "2022-11-28" } -Uri https://api.github.com/repos/VirtoCommerce/vc-module-subscription/commits/${{ github.SHA }}/pulls | convertFrom-Json echo "merge_commit_sha=$($r.merge_commit_sha)" >> GITHUB_ENV + - name: Report check - # if: ${{ github.event.inputs.used-branch && steps.module-katalon-tests.outcome }} if: ${{ github.event_name == 'workflow_dispatch' }} uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - github.checks.create({ + const owner = context.repo.owner; + const repo = context.repo.repo; + const sha = '${{ env.merge_commit_sha }}'; + const conclusion = '${{ steps.module-katalon-tests.outcome }}'; + const summary = `Results: ${conclusion}`; + + await github.checks.create({ + owner, + repo, name: 'run tests', - head_sha: '${{ env.merge_commit_sha }}', + head_sha: sha, status: 'completed', - conclusion: '${{ steps.module-katalon-tests.outcome }}', + conclusion: conclusion, output: { title: 'Run tests', - summary: 'Results: ${{ steps.module-katalon-tests.outcome }}' - }, - owner: context.repo.owner, - repo: context.repo.repo - }) + summary: summary + } + }); + # - name: Report check + # # if: ${{ github.event.inputs.used-branch && steps.module-katalon-tests.outcome }} + # if: ${{ github.event_name == 'workflow_dispatch' }} + # uses: actions/github-script@v7 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # script: | + # github.checks.create({ + # name: 'run tests', + # head_sha: '${{ env.merge_commit_sha }}', + # status: 'completed', + # conclusion: '${{ steps.module-katalon-tests.outcome }}', + # output: { + # title: 'Run tests', + # summary: 'Results: ${{ steps.module-katalon-tests.outcome }}' + # }, + # owner: context.repo.owner, + # repo: context.repo.repo + # }) deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} needs: ci From adcc75f9fed439b94f31a4dab8b4198ea494be01 Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 16:03:00 +0500 Subject: [PATCH 21/36] VCST-1783: Enable all steps for testing triggered workflow run --- .github/workflows/module-ci.yml | 418 ++++++++++++++++---------------- 1 file changed, 209 insertions(+), 209 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 6b6835a..378ee22 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -20,7 +20,7 @@ on: branches: [master, main, dev] paths-ignore: - - '.github/**' + # - '.github/**' - 'docs/**' - 'build/**' - 'README.md' @@ -47,14 +47,14 @@ jobs: BUILD_STATE: 'failed' RELEASE_STATUS: 'false' - # outputs: - # artifactUrl: ${{ steps.artifactUrl.outputs.download_url }} - # blobId: ${{ steps.blobRelease.outputs.blobId }} - # jira-keys: ${{ steps.jira_keys.outputs.jira-keys }} - # version: ${{ steps.artifact_ver.outputs.shortVersion }} - # moduleId: ${{ steps.artifact_ver.outputs.moduleId }} - # matrix: ${{ steps.deployment-matrix.outputs.matrix }} - # run-e2e: ${{ steps.run-e2e.outputs.result }} + outputs: + artifactUrl: ${{ steps.artifactUrl.outputs.download_url }} + blobId: ${{ steps.blobRelease.outputs.blobId }} + jira-keys: ${{ steps.jira_keys.outputs.jira-keys }} + version: ${{ steps.artifact_ver.outputs.shortVersion }} + moduleId: ${{ steps.artifact_ver.outputs.moduleId }} + matrix: ${{ steps.deployment-matrix.outputs.matrix }} + run-e2e: ${{ steps.run-e2e.outputs.result }} steps: @@ -63,180 +63,180 @@ jobs: with: node-version: '20' - # - name: Set up Java 17 - # uses: actions/setup-java@v4 - # with: - # distribution: 'temurin' - # java-version: '17' + - name: Set up Java 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' - # - name: Set RELEASE_STATUS - # if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.event_name == 'push' }} - # run: | - # echo "RELEASE_STATUS=true" >> $GITHUB_ENV + - name: Set RELEASE_STATUS + if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.event_name == 'push' }} + run: | + echo "RELEASE_STATUS=true" >> $GITHUB_ENV - # - uses: actions/checkout@v4 - # with: - # fetch-depth: 0 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - # - name: Install VirtoCommerce.GlobalTool - # uses: VirtoCommerce/vc-github-actions/setup-vcbuild@master + - name: Install VirtoCommerce.GlobalTool + uses: VirtoCommerce/vc-github-actions/setup-vcbuild@master - # - name: Install dotnet-sonarscanner - # run: dotnet tool install --global dotnet-sonarscanner + - name: Install dotnet-sonarscanner + run: dotnet tool install --global dotnet-sonarscanner - # - name: Get Changelog - # id: changelog - # uses: VirtoCommerce/vc-github-actions/changelog-generator@master + - name: Get Changelog + id: changelog + uses: VirtoCommerce/vc-github-actions/changelog-generator@master - # - name: Get Artifact Version - # uses: VirtoCommerce/vc-github-actions/get-image-version@master - # id: artifact_ver + - name: Get Artifact Version + uses: VirtoCommerce/vc-github-actions/get-image-version@master + id: artifact_ver - # - name: Set VERSION_SUFFIX variable - # run: | - # if [ '${{ github.event_name }}' = 'workflow_dispatch' ]; then - # echo "VERSION_SUFFIX=${{ steps.artifact_ver.outputs.fullSuffix }}" >> $GITHUB_ENV - # 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 - # with: - # versionSuffix: ${{ env.VERSION_SUFFIX }} + - name: Set VERSION_SUFFIX variable + run: | + if [ '${{ github.event_name }}' = 'workflow_dispatch' ]; then + echo "VERSION_SUFFIX=${{ steps.artifact_ver.outputs.fullSuffix }}" >> $GITHUB_ENV + 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 + with: + versionSuffix: ${{ env.VERSION_SUFFIX }} - # - name: SonarCloud Begin - # uses: VirtoCommerce/vc-github-actions/sonar-scanner-begin@master - # with: - # repoOrg: ${{ github.repository_owner }} - # sonarOrg: ${{secrets.SONAR_ORG_KEY}} + - name: SonarCloud Begin + uses: VirtoCommerce/vc-github-actions/sonar-scanner-begin@master + with: + repoOrg: ${{ github.repository_owner }} + sonarOrg: ${{secrets.SONAR_ORG_KEY}} - # - name: Build - # run: vc-build Compile + - name: Build + run: vc-build Compile - # - name: Unit Tests - # run: vc-build Test -skip + - name: Unit Tests + run: vc-build Test -skip - # - name: SonarCloud End - # uses: VirtoCommerce/vc-github-actions/sonar-scanner-end@master + - name: SonarCloud End + uses: VirtoCommerce/vc-github-actions/sonar-scanner-end@master - # - name: Quality Gate - # uses: VirtoCommerce/vc-github-actions/sonar-quality-gate@master - # with: - # login: ${{secrets.SONAR_TOKEN}} + - name: Quality Gate + uses: VirtoCommerce/vc-github-actions/sonar-quality-gate@master + with: + login: ${{secrets.SONAR_TOKEN}} - # - name: Packaging - # run: vc-build Compress -skip Clean+Restore+Compile+Test + - name: Packaging + run: vc-build Compress -skip Clean+Restore+Compile+Test - # - name: Publish Nuget - # if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} - # uses: VirtoCommerce/vc-github-actions/publish-nuget@master + - name: Publish Nuget + if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} + uses: VirtoCommerce/vc-github-actions/publish-nuget@master - # - name: Publish to Blob - # if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main') }} - # id: blobRelease - # uses: VirtoCommerce/vc-github-actions/publish-blob-release@master - # with: - # blobSAS: ${{ secrets.BLOB_TOKEN }} - # blobUrl: ${{ vars.BLOB_URL }} + - name: Publish to Blob + if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main') }} + id: blobRelease + uses: VirtoCommerce/vc-github-actions/publish-blob-release@master + with: + blobSAS: ${{ secrets.BLOB_TOKEN }} + blobUrl: ${{ vars.BLOB_URL }} - # - name: Add Jira link - # if: ${{ github.event_name == 'pull_request' }} - # uses: VirtoCommerce/vc-github-actions/publish-jira-link@master - # with: - # branchName: ${{ github.head_ref }} - # repoOrg: ${{ github.repository_owner }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Add Jira link + if: ${{ github.event_name == 'pull_request' }} + uses: VirtoCommerce/vc-github-actions/publish-jira-link@master + with: + branchName: ${{ github.head_ref }} + repoOrg: ${{ github.repository_owner }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Add link to PR - # if: ${{ github.event_name == 'pull_request' }} - # uses: VirtoCommerce/vc-github-actions/publish-artifact-link@master - # with: - # artifactUrl: ${{ steps.blobRelease.outputs.packageUrl }} - # repoOrg: ${{ github.repository_owner }} - # downloadComment: 'Artifact URL:' + - name: Add link to PR + if: ${{ github.event_name == 'pull_request' }} + uses: VirtoCommerce/vc-github-actions/publish-artifact-link@master + with: + artifactUrl: ${{ steps.blobRelease.outputs.packageUrl }} + repoOrg: ${{ github.repository_owner }} + downloadComment: 'Artifact URL:' - # - name: Publish Github Release - # if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} - # id: githubRelease - # with: - # changelog: ${{ steps.changelog.outputs.changelog }} - # organization: ${{ github.repository_owner }} - # uses: VirtoCommerce/vc-github-actions/publish-github-release@master + - name: Publish Github Release + if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} + id: githubRelease + with: + changelog: ${{ steps.changelog.outputs.changelog }} + organization: ${{ github.repository_owner }} + uses: VirtoCommerce/vc-github-actions/publish-github-release@master - # - name: Set artifactUrl value - # id: artifactUrl - # run: | - # if [ '${{ github.ref }}' = 'refs/heads/master' ] || [ '${{ github.ref }}' = 'refs/heads/main' ]; then - # echo "download_url=${{ steps.githubRelease.outputs.downloadUrl }}" >> $GITHUB_OUTPUT - # else - # echo "download_url=${{ steps.blobRelease.outputs.packageUrl }}" >> $GITHUB_OUTPUT - # fi; + - name: Set artifactUrl value + id: artifactUrl + run: | + if [ '${{ github.ref }}' = 'refs/heads/master' ] || [ '${{ github.ref }}' = 'refs/heads/main' ]; then + echo "download_url=${{ steps.githubRelease.outputs.downloadUrl }}" >> $GITHUB_OUTPUT + else + echo "download_url=${{ steps.blobRelease.outputs.packageUrl }}" >> $GITHUB_OUTPUT + fi; - # - name: Create deployment matrix - # if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} - # uses: VirtoCommerce/vc-github-actions/cloud-create-deploy-matrix@master - # id: deployment-matrix - # with: - # deployConfigPath: '.deployment/module/cloudDeploy.json' - # releaseBranch: 'master' + - name: Create deployment matrix + if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} + uses: VirtoCommerce/vc-github-actions/cloud-create-deploy-matrix@master + id: deployment-matrix + with: + deployConfigPath: '.deployment/module/cloudDeploy.json' + releaseBranch: 'master' - # - name: Check commit message for version number - # id: run-e2e - # run: | - # if [[ "${{ github.event.head_commit.message }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; - # then - # echo "result=false" >> $GITHUB_OUTPUT - # else - # echo "result=true" >> $GITHUB_OUTPUT - # fi + - name: Check commit message for version number + id: run-e2e + run: | + if [[ "${{ github.event.head_commit.message }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; + then + echo "result=false" >> $GITHUB_OUTPUT + else + echo "result=true" >> $GITHUB_OUTPUT + fi - # - 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 - # with: - # githubToken: ${{ secrets.REPO_TOKEN }} + - 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 + with: + githubToken: ${{ secrets.REPO_TOKEN }} - # - name: Publish Manifest - # 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/publish-manifest@master - # with: - # packageUrl: ${{ steps.artifactUrl.outputs.download_url }} + - name: Publish Manifest + 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/publish-manifest@master + with: + packageUrl: ${{ steps.artifactUrl.outputs.download_url }} - # - name: Parse Jira Keys from All Commits - # uses: VirtoCommerce/vc-github-actions/get-jira-keys@master - # if: always() - # id: jira_keys - # with: - # release: ${{ env.RELEASE_STATUS }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Parse Jira Keys from All Commits + uses: VirtoCommerce/vc-github-actions/get-jira-keys@master + if: always() + id: jira_keys + with: + release: ${{ env.RELEASE_STATUS }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Push Build Info to Jira - # if: ${{ env.CLOUD_INSTANCE_BASE_URL != 0 && env.CLIENT_ID != 0 && env.CLIENT_SECRET != 0 && steps.jira_keys.outputs.jira-keys != '' && always() }} - # id: push_build_info_to_jira - # uses: VirtoCommerce/jira-upload-build-info@master - # with: - # cloud-instance-base-url: '${{ secrets.CLOUD_INSTANCE_BASE_URL }}' - # client-id: '${{ secrets.CLIENT_ID }}' - # client-secret: '${{ secrets.CLIENT_SECRET }}' - # pipeline-id: '${{ github.repository }} ${{ github.workflow }}' - # build-number: ${{ github.run_number }} - # build-display-name: 'Workflow: ${{ github.workflow }} (#${{ github.run_number }})' - # build-state: '${{ env.BUILD_STATE }}' - # build-url: '${{github.event.repository.url}}/actions/runs/${{github.run_id}}' - # update-sequence-number: '${{ github.run_id }}' - # last-updated: '${{github.event.head_commit.timestamp}}' - # issue-keys: '${{ steps.jira_keys.outputs.jira-keys }}' - # commit-id: '${{ github.sha }}' - # repo-url: '${{ github.event.repository.url }}' - # build-ref-url: '${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}' + - name: Push Build Info to Jira + if: ${{ env.CLOUD_INSTANCE_BASE_URL != 0 && env.CLIENT_ID != 0 && env.CLIENT_SECRET != 0 && steps.jira_keys.outputs.jira-keys != '' && always() }} + id: push_build_info_to_jira + uses: VirtoCommerce/jira-upload-build-info@master + with: + cloud-instance-base-url: '${{ secrets.CLOUD_INSTANCE_BASE_URL }}' + client-id: '${{ secrets.CLIENT_ID }}' + client-secret: '${{ secrets.CLIENT_SECRET }}' + pipeline-id: '${{ github.repository }} ${{ github.workflow }}' + build-number: ${{ github.run_number }} + build-display-name: 'Workflow: ${{ github.workflow }} (#${{ github.run_number }})' + build-state: '${{ env.BUILD_STATE }}' + build-url: '${{github.event.repository.url}}/actions/runs/${{github.run_id}}' + update-sequence-number: '${{ github.run_id }}' + last-updated: '${{github.event.head_commit.timestamp}}' + issue-keys: '${{ steps.jira_keys.outputs.jira-keys }}' + commit-id: '${{ github.sha }}' + repo-url: '${{ github.event.repository.url }}' + build-ref-url: '${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}' - # - name: Confirm Jira Build Output - # if: success() - # run: | - # echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" + - name: Confirm Jira Build Output + if: success() + run: | + echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" module-katalon-tests: if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch')}} @@ -256,60 +256,60 @@ jobs: envPAT: ${{ secrets.REPO_TOKEN }} katalonApiKey: ${{ secrets.KATALON_API_KEY }} - check-tests-status: - runs-on: ubuntu-latest - needs: 'module-katalon-tests' - steps: - - name: get sha - id: get-sha - shell: pwsh - run: | - $r = Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.REPO_TOKEN }}"; "Accept" = "application/vnd.github.v3+json"; "X-GitHub-Api-Version" = "2022-11-28" } -Uri https://api.github.com/repos/VirtoCommerce/vc-module-subscription/commits/${{ github.SHA }}/pulls | convertFrom-Json - echo "merge_commit_sha=$($r.merge_commit_sha)" >> GITHUB_ENV + # check-tests-status: + # runs-on: ubuntu-latest + # needs: 'module-katalon-tests' + # steps: + # - name: get sha + # id: get-sha + # shell: pwsh + # run: | + # $r = Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.REPO_TOKEN }}"; "Accept" = "application/vnd.github.v3+json"; "X-GitHub-Api-Version" = "2022-11-28" } -Uri https://api.github.com/repos/VirtoCommerce/vc-module-subscription/commits/${{ github.SHA }}/pulls | convertFrom-Json + # echo "merge_commit_sha=$($r.merge_commit_sha)" >> GITHUB_ENV - - name: Report check - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const owner = context.repo.owner; - const repo = context.repo.repo; - const sha = '${{ env.merge_commit_sha }}'; - const conclusion = '${{ steps.module-katalon-tests.outcome }}'; - const summary = `Results: ${conclusion}`; + # - name: Report check + # if: ${{ github.event_name == 'workflow_dispatch' }} + # uses: actions/github-script@v7 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # script: | + # const owner = context.repo.owner; + # const repo = context.repo.repo; + # const sha = '${{ env.merge_commit_sha }}'; + # const conclusion = '${{ steps.module-katalon-tests.outcome }}'; + # const summary = `Results: ${conclusion}`; - await github.checks.create({ - owner, - repo, - name: 'run tests', - head_sha: sha, - status: 'completed', - conclusion: conclusion, - output: { - title: 'Run tests', - summary: summary - } - }); - # - name: Report check - # # if: ${{ github.event.inputs.used-branch && steps.module-katalon-tests.outcome }} - # if: ${{ github.event_name == 'workflow_dispatch' }} - # uses: actions/github-script@v7 - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # script: | - # github.checks.create({ - # name: 'run tests', - # head_sha: '${{ env.merge_commit_sha }}', - # status: 'completed', - # conclusion: '${{ steps.module-katalon-tests.outcome }}', - # output: { - # title: 'Run tests', - # summary: 'Results: ${{ steps.module-katalon-tests.outcome }}' - # }, - # owner: context.repo.owner, - # repo: context.repo.repo - # }) + # await github.checks.create({ + # owner, + # repo, + # name: 'run tests', + # head_sha: sha, + # status: 'completed', + # conclusion: conclusion, + # output: { + # title: 'Run tests', + # summary: summary + # } + # }); + # # - name: Report check + # # # if: ${{ github.event.inputs.used-branch && steps.module-katalon-tests.outcome }} + # # if: ${{ github.event_name == 'workflow_dispatch' }} + # # uses: actions/github-script@v7 + # # with: + # # github-token: ${{ secrets.GITHUB_TOKEN }} + # # script: | + # # github.checks.create({ + # # name: 'run tests', + # # head_sha: '${{ env.merge_commit_sha }}', + # # status: 'completed', + # # conclusion: '${{ steps.module-katalon-tests.outcome }}', + # # output: { + # # title: 'Run tests', + # # summary: 'Results: ${{ steps.module-katalon-tests.outcome }}' + # # }, + # # owner: context.repo.owner, + # # repo: context.repo.repo + # # }) deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} needs: ci From 973c97fb96afe63c9cd3e7573b2e22807993ef09 Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 16:05:44 +0500 Subject: [PATCH 22/36] VCST-1738: Temporary disable sonar --- .github/workflows/module-ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 378ee22..c4a7417 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -105,11 +105,11 @@ jobs: with: versionSuffix: ${{ env.VERSION_SUFFIX }} - - name: SonarCloud Begin - uses: VirtoCommerce/vc-github-actions/sonar-scanner-begin@master - with: - repoOrg: ${{ github.repository_owner }} - sonarOrg: ${{secrets.SONAR_ORG_KEY}} + # - name: SonarCloud Begin + # uses: VirtoCommerce/vc-github-actions/sonar-scanner-begin@master + # with: + # repoOrg: ${{ github.repository_owner }} + # sonarOrg: ${{secrets.SONAR_ORG_KEY}} - name: Build run: vc-build Compile @@ -117,13 +117,13 @@ jobs: - name: Unit Tests run: vc-build Test -skip - - name: SonarCloud End - uses: VirtoCommerce/vc-github-actions/sonar-scanner-end@master + # - name: SonarCloud End + # uses: VirtoCommerce/vc-github-actions/sonar-scanner-end@master - - name: Quality Gate - uses: VirtoCommerce/vc-github-actions/sonar-quality-gate@master - with: - login: ${{secrets.SONAR_TOKEN}} + # - name: Quality Gate + # uses: VirtoCommerce/vc-github-actions/sonar-quality-gate@master + # with: + # login: ${{secrets.SONAR_TOKEN}} - name: Packaging run: vc-build Compress -skip Clean+Restore+Compile+Test From 6474b5f7c6c8ff3cfe32c44ccfee49eb863e285b Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 16:08:28 +0500 Subject: [PATCH 23/36] VCST-1738: Temporary disable condition for e3e tests --- .github/workflows/module-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index c4a7417..dd039f3 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -239,7 +239,7 @@ jobs: echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" module-katalon-tests: - if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch')}} + # if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch')}} needs: 'ci' uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 with: From abc1fc0c6857225d8ac275d0642411e0300bed5a Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 16:24:27 +0500 Subject: [PATCH 24/36] VCST-1738: Add condition for e2e on commit message --- .github/workflows/module-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index dd039f3..23b5e00 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -239,7 +239,7 @@ jobs: echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" module-katalon-tests: - # if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch')}} + if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch') || (contains(github.event.head_commit.message, 'e2e'))}} needs: 'ci' uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 with: From 0990ecd9fdbc7fcf4405cb691774236e38ba834d Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 16:32:31 +0500 Subject: [PATCH 25/36] VCST-1738: Fix condition for e2e --- .github/workflows/module-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 23b5e00..75eff09 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -239,7 +239,7 @@ jobs: echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" module-katalon-tests: - if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch') || (contains(github.event.head_commit.message, 'e2e'))}} + if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch') || (contains(github.event.head_commit.message || github.event.commits[0].message || '', 'e2e'))}} needs: 'ci' uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 with: From d89c47e122e216da98650f7a1bb9514076a92a6f Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 16:44:09 +0500 Subject: [PATCH 26/36] VCST-1738: Add debug print --- .github/workflows/module-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 75eff09..6c5e6d3 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -238,6 +238,13 @@ jobs: run: | echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" + - name: Print debug info + run: | + echo "Branch: ${{ github.ref }}" + echo "Event Name: ${{ github.event_name }}" + echo "Head Commit Message: ${{ github.event.head_commit.message }}" + echo "First Commit Message: ${{ github.event.commits[0].message }}" + module-katalon-tests: if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch') || (contains(github.event.head_commit.message || github.event.commits[0].message || '', 'e2e'))}} needs: 'ci' From 1b6f1d5179c7f9de36f03735435239b58368b678 Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 17:01:01 +0500 Subject: [PATCH 27/36] VCST-1738: Add a step to get commit message [run e2e] --- .github/workflows/module-ci.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 6c5e6d3..1bc7474 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -55,6 +55,7 @@ jobs: moduleId: ${{ steps.artifact_ver.outputs.moduleId }} matrix: ${{ steps.deployment-matrix.outputs.matrix }} run-e2e: ${{ steps.run-e2e.outputs.result }} + head-commit-message: ${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }} steps: @@ -238,15 +239,12 @@ jobs: run: | echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" - - name: Print debug info - run: | - echo "Branch: ${{ github.ref }}" - echo "Event Name: ${{ github.event_name }}" - echo "Head Commit Message: ${{ github.event.head_commit.message }}" - echo "First Commit Message: ${{ github.event.commits[0].message }}" + - name: Get Head Commit Message + id: get_head_commit_message + run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" module-katalon-tests: - if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch') || (contains(github.event.head_commit.message || github.event.commits[0].message || '', 'e2e'))}} + if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch') || (contains(needs.ci.outputs.head-commit-message, '[run e2e]'))}} needs: 'ci' uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 with: From f1c813987b1de89153f14c22977a35903beb79e2 Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 17:05:50 +0500 Subject: [PATCH 28/36] VCST-1738: Add logging [run e2e] --- .github/workflows/module-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 1bc7474..44215c5 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -241,7 +241,9 @@ jobs: - name: Get Head Commit Message id: get_head_commit_message - run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" + run: | + echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" + echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" module-katalon-tests: if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch') || (contains(needs.ci.outputs.head-commit-message, '[run e2e]'))}} From 9c4a25da3ce5d8a1dfe5948d842606b2a90d93f8 Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 17:10:02 +0500 Subject: [PATCH 29/36] VCST-1738: Add checkout [run e2e] --- .github/workflows/module-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 44215c5..3fba584 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -239,6 +239,11 @@ jobs: run: | echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" + - name: Get repo + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Get Head Commit Message id: get_head_commit_message run: | From 8a4507cbb6aa965c622ede57ebbdfffa37970fd4 Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 17:25:18 +0500 Subject: [PATCH 30/36] VCST-1738: Check commit message without e2e tag --- .github/workflows/module-ci.yml | 54 --------------------------------- 1 file changed, 54 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 3fba584..25258c7 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -268,60 +268,6 @@ jobs: envPAT: ${{ secrets.REPO_TOKEN }} katalonApiKey: ${{ secrets.KATALON_API_KEY }} - # check-tests-status: - # runs-on: ubuntu-latest - # needs: 'module-katalon-tests' - # steps: - # - name: get sha - # id: get-sha - # shell: pwsh - # run: | - # $r = Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.REPO_TOKEN }}"; "Accept" = "application/vnd.github.v3+json"; "X-GitHub-Api-Version" = "2022-11-28" } -Uri https://api.github.com/repos/VirtoCommerce/vc-module-subscription/commits/${{ github.SHA }}/pulls | convertFrom-Json - # echo "merge_commit_sha=$($r.merge_commit_sha)" >> GITHUB_ENV - - # - name: Report check - # if: ${{ github.event_name == 'workflow_dispatch' }} - # uses: actions/github-script@v7 - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # script: | - # const owner = context.repo.owner; - # const repo = context.repo.repo; - # const sha = '${{ env.merge_commit_sha }}'; - # const conclusion = '${{ steps.module-katalon-tests.outcome }}'; - # const summary = `Results: ${conclusion}`; - - # await github.checks.create({ - # owner, - # repo, - # name: 'run tests', - # head_sha: sha, - # status: 'completed', - # conclusion: conclusion, - # output: { - # title: 'Run tests', - # summary: summary - # } - # }); - # # - name: Report check - # # # if: ${{ github.event.inputs.used-branch && steps.module-katalon-tests.outcome }} - # # if: ${{ github.event_name == 'workflow_dispatch' }} - # # uses: actions/github-script@v7 - # # with: - # # github-token: ${{ secrets.GITHUB_TOKEN }} - # # script: | - # # github.checks.create({ - # # name: 'run tests', - # # head_sha: '${{ env.merge_commit_sha }}', - # # status: 'completed', - # # conclusion: '${{ steps.module-katalon-tests.outcome }}', - # # output: { - # # title: 'Run tests', - # # summary: 'Results: ${{ steps.module-katalon-tests.outcome }}' - # # }, - # # owner: context.repo.owner, - # # repo: context.repo.repo - # # }) deploy-cloud: if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} needs: ci From 1a6225af93953426d67639858e302cf704e3e28b Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Tue, 24 Sep 2024 17:35:47 +0500 Subject: [PATCH 31/36] VCST-1738: Enable sonar steps [run e2e] --- .github/workflows/module-ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 25258c7..66d821e 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -106,11 +106,11 @@ jobs: with: versionSuffix: ${{ env.VERSION_SUFFIX }} - # - name: SonarCloud Begin - # uses: VirtoCommerce/vc-github-actions/sonar-scanner-begin@master - # with: - # repoOrg: ${{ github.repository_owner }} - # sonarOrg: ${{secrets.SONAR_ORG_KEY}} + - name: SonarCloud Begin + uses: VirtoCommerce/vc-github-actions/sonar-scanner-begin@master + with: + repoOrg: ${{ github.repository_owner }} + sonarOrg: ${{secrets.SONAR_ORG_KEY}} - name: Build run: vc-build Compile @@ -118,13 +118,13 @@ jobs: - name: Unit Tests run: vc-build Test -skip - # - name: SonarCloud End - # uses: VirtoCommerce/vc-github-actions/sonar-scanner-end@master + - name: SonarCloud End + uses: VirtoCommerce/vc-github-actions/sonar-scanner-end@master - # - name: Quality Gate - # uses: VirtoCommerce/vc-github-actions/sonar-quality-gate@master - # with: - # login: ${{secrets.SONAR_TOKEN}} + - name: Quality Gate + uses: VirtoCommerce/vc-github-actions/sonar-quality-gate@master + with: + login: ${{secrets.SONAR_TOKEN}} - name: Packaging run: vc-build Compress -skip Clean+Restore+Compile+Test From 0ede836d7f5c7384324d84f3f8725822c4107bdc Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Wed, 25 Sep 2024 08:19:45 +0500 Subject: [PATCH 32/36] VCST-1738: Step rename --- .github/workflows/module-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 66d821e..32bbc60 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -239,7 +239,7 @@ jobs: run: | echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" - - name: Get repo + - name: Checkout current commit uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} From 4c8fa20d882c606a4a23254cf0f0c0020d76e8ce Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Wed, 25 Sep 2024 08:21:44 +0500 Subject: [PATCH 33/36] VCST-1738: Add comments [run e2e] --- .github/workflows/module-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 32bbc60..e7b7e5d 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -239,12 +239,12 @@ jobs: run: | echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" - - name: Checkout current commit + - name: Checkout current commit #for parsing commit message for the e2e tests condition uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - - name: Get Head Commit Message + - name: Get Head Commit Message #for parsing commit message for the e2e tests condition id: get_head_commit_message run: | echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" From d225f137ccafe60059d79344963a91e797b0122a Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Wed, 25 Sep 2024 08:28:35 +0500 Subject: [PATCH 34/36] VCST-1738: Step rename --- .github/workflows/module-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index e7b7e5d..d6e1218 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -244,7 +244,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - name: Get Head Commit Message #for parsing commit message for the e2e tests condition + - name: Get current commit #for parsing commit message for the e2e tests condition id: get_head_commit_message run: | echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" From e59327834b2d48fb90c0e383c8273c3cce7e98bc Mon Sep 17 00:00:00 2001 From: Andrew Kubyshkin Date: Wed, 25 Sep 2024 13:41:13 +0500 Subject: [PATCH 35/36] VCST-1738: Change condition for e2e --- .github/workflows/module-ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index d6e1218..49bd5b8 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -239,19 +239,20 @@ jobs: run: | echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}" - - name: Checkout current commit #for parsing commit message for the e2e tests condition - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} + # - name: Checkout current commit #for parsing commit message for the e2e tests condition + # uses: actions/checkout@v4 + # with: + # ref: ${{ github.event.pull_request.head.sha }} - - name: Get current commit #for parsing commit message for the e2e tests condition - id: get_head_commit_message - run: | - echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" - echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" + # - name: Get current commit #for parsing commit message for the e2e tests condition + # id: get_head_commit_message + # run: | + # echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" + # echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" module-katalon-tests: - if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch') || (contains(needs.ci.outputs.head-commit-message, '[run e2e]'))}} + # if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) || (github.event_name == 'workflow_dispatch') || (contains(needs.ci.outputs.head-commit-message, '[run e2e]'))}} + if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'dev') }} needs: 'ci' uses: VirtoCommerce/.github/.github/workflows/e2e.yml@VCST-1738 with: From 5eb0c8e5bd2dbdcfb6bc7c09586c6b76232d1344 Mon Sep 17 00:00:00 2001 From: Andrew <56427313+AndrewEhlo@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:21:12 +0500 Subject: [PATCH 36/36] VCST-1738: Enable PR workflow trigger --- .github/workflows/module-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 49bd5b8..b9e4b2e 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -18,7 +18,7 @@ on: [master, main, dev] pull_request: branches: - [master, main, dev] + [master, main, dev, VCST-1738] paths-ignore: # - '.github/**' - 'docs/**'