From 80c4e94a63f413e08052ee95a7d64b16996bda68 Mon Sep 17 00:00:00 2001 From: Daniil Tkachev Date: Mon, 30 Dec 2024 15:11:05 +0100 Subject: [PATCH] TC-47 test cypress --- .../workflows/universal_workflow_light.yaml | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/universal_workflow_light.yaml b/.github/workflows/universal_workflow_light.yaml index eed42eb..e4a7053 100644 --- a/.github/workflows/universal_workflow_light.yaml +++ b/.github/workflows/universal_workflow_light.yaml @@ -1164,6 +1164,14 @@ jobs: logfile: load_testplan_runscript.log token: ${{ secrets.enterprise_github_token || github.token }} + - name: Set Cypress Variables + run: | + echo "cypress_composer_transform=some_value" >> $GITHUB_ENV + echo "cypress_composer_early=false" >> $GITHUB_ENV + echo "cypress_container_name=php" >> $GITHUB_ENV + echo "cypress_container_options=" >> $GITHUB_ENV + echo "cypress_path=/var/www/html" >> $GITHUB_ENV + - name: Convert variables id: cy shell: bash @@ -1226,14 +1234,6 @@ jobs: sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g' | \ tee -a "${GITHUB_OUTPUT}" - - name: Set Cypress Variables - run: | - echo "cypress_composer_transform=some_value" >> $GITHUB_ENV - echo "cypress_composer_early=false" >> $GITHUB_ENV - echo "cypress_container_name=php" >> $GITHUB_ENV - echo "cypress_container_options=" >> $GITHUB_ENV - echo "cypress_path=/var/www/html" >> $GITHUB_ENV - - name: Debug Outputs run: | echo "cypress_composer_transform: ${{ steps.cy.outputs.cypress_composer_transform }}" @@ -1242,6 +1242,7 @@ jobs: echo "cypress_container_options: ${{ steps.cy.outputs.cypress_container_options }}" echo "cypress_path: ${{ steps.cy.outputs.cypress_path }}" + - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: @@ -1271,20 +1272,20 @@ jobs: debug: ${{ needs.init.outputs.debug }} github_token: ${{ secrets.enterprise_github_token || github.token }} + - name: Run composer if there is no transform - # Only run this if there is no transformation and composer_early is set to 'false' - if: ${{ steps.cy.outputs.cypress_composer_transform == '' && steps.cy.outputs.cypress_composer_early == 'false' }} + if: ${{ (steps.cy.outputs.cypress_composer_transform == '' || !steps.cy.outputs.cypress_composer_transform) && (steps.cy.outputs.cypress_composer_early == 'false' || !steps.cy.outputs.cypress_composer_early) }} run: | # run composer ${{ inputs.debug }} docker compose exec -T \ - ${{ steps.cy.outputs.cypress_container_options }} \ - ${{ steps.cy.outputs.cypress_container_name }} \ + ${{ steps.cy.outputs.cypress_container_options || '--user=www-data' }} \ + ${{ steps.cy.outputs.cypress_container_name || 'php' }} \ composer config -g github-oauth.github.com "${{ secrets.enterprise_github_token || github.token }}" docker compose exec -T \ - ${{ steps.cy.outputs.cypress_container_options }} \ - ${{ steps.cy.outputs.cypress_container_name }} \ - composer update --no-interaction -d "/var/www/${{ steps.cy.outputs.cypress_path }}" + ${{ steps.cy.outputs.cypress_container_options || '--user=www-data' }} \ + ${{ steps.cy.outputs.cypress_container_name || 'php' }} \ + composer update --no-interaction -d "/var/www/${{ steps.cy.outputs.cypress_path || 'html' }}" - name: Run custom scripts uses: 'OXID-eSales/github-actions/run_custom_scripts@v4'