diff --git a/.github/workflows/pullRequestsCommandCypressTest.yml b/.github/workflows/pullRequestsCommandCypressTest.yml index 63eb8f58c84..79de31b9f72 100644 --- a/.github/workflows/pullRequestsCommandCypressTest.yml +++ b/.github/workflows/pullRequestsCommandCypressTest.yml @@ -178,18 +178,15 @@ jobs: run: > mkdir ~/.webiny && echo '{ "id": "ci", "telemetry": false }' > ~/.webiny/config - - name: Create directory - run: mkdir npx-cwp - name: Create a new Webiny project - working-directory: npx-cwp run: > - npx create-webiny-project@local-npm test-project --tag local-npm + npx create-webiny-project@local-npm new-webiny-project --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' --template-options '{"region":"${{ env.AWS_REGION }}","storageOperations":"ddb"}' - name: Print CLI version - working-directory: npx-cwp/new-webiny-project + working-directory: new-webiny-project run: yarn webiny --version - name: Create project-files artifact uses: actions/upload-artifact@v4 @@ -197,25 +194,25 @@ jobs: name: project-files-ddb retention-days: 1 path: |- - npx-cwp/new-webiny-project/ - !npx-cwp/new-webiny-project/node_modules/**/* - !npx-cwp/new-webiny-project/**/node_modules/**/* - !npx-cwp/new-webiny-project/.yarn/cache/**/* + new-webiny-project/ + !new-webiny-project/node_modules/**/* + !new-webiny-project/**/node_modules/**/* + !new-webiny-project/.yarn/cache/**/* - name: Deploy Core - working-directory: npx-cwp/new-webiny-project + working-directory: new-webiny-project run: yarn webiny deploy apps/core --env dev - name: Deploy API - working-directory: npx-cwp/new-webiny-project + working-directory: new-webiny-project run: yarn webiny deploy apps/api --env dev - name: Deploy Admin Area - working-directory: npx-cwp/new-webiny-project + working-directory: new-webiny-project run: yarn webiny deploy apps/admin --env dev - name: Deploy Website - working-directory: npx-cwp/new-webiny-project + working-directory: new-webiny-project run: yarn webiny deploy apps/website --env dev - name: Create Cypress config working-directory: checked-out-pr - run: yarn setup-cypress --projectFolder ../npx-cwp/new-webiny-project + run: yarn setup-cypress --projectFolder ../new-webiny-project - name: Save Cypress config id: save-cypress-config working-directory: checked-out-pr @@ -290,5 +287,498 @@ jobs: }}' > cypress-tests/cypress.config.ts - name: Cypress - run "${{ matrix.cypress-folder }}" tests timeout-minutes: 40 + working-directory: checked-out-pr + run: yarn cy:run --browser chrome --spec "${{ matrix.cypress-folder }}" + runs-on: ubuntu-latest + e2e-wby-cms-ddb-es-constants: + needs: checkComment + name: E2E (DDB-ES) - Constants + outputs: + global-cache-key: ${{ steps.global-cache-key.outputs.global-cache-key }} + run-cache-key: ${{ steps.run-cache-key.outputs.run-cache-key }} + cypress-folders: ${{ steps.list-cypress-folders.outputs.cypress-folders }} + pulumi-backend-url: ${{ steps.pulumi-backend-url.outputs.pulumi-backend-url }} + steps: + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/checkout@v4 + - name: Install Hub Utility + run: sudo apt-get install -y hub + - name: Checkout Pull Request + working-directory: '' + run: hub pr checkout ${{ github.event.issue.number }} + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Create global cache key + id: global-cache-key + run: >- + echo "global-cache-key=$(hub pr show ${{ github.event.issue.number }} + -f %B)-${{ runner.os }}-$(/bin/date -u "+%m%d")-${{ + vars.RANDOM_CACHE_KEY_SUFFIX }}" >> $GITHUB_OUTPUT + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Create workflow run cache key + id: run-cache-key + run: >- + echo "run-cache-key=${{ github.run_id }}-${{ github.run_attempt }}-${{ + vars.RANDOM_CACHE_KEY_SUFFIX }}" >> $GITHUB_OUTPUT + - name: List Cypress tests folders + id: list-cypress-folders + run: >- + echo "cypress-folders=$(node scripts/listCypressTestsFolders.js)" >> + $GITHUB_OUTPUT + - name: Get Pulumi backend URL + id: get-pulumi-backend-url + run: >- + echo "pulumi-backend-url=${{ secrets.WEBINY_PULUMI_BACKEND }}${{ + github.run_id }}_ddb-es" >> $GITHUB_OUTPUT + runs-on: ubuntu-latest + env: + NODE_OPTIONS: '--max_old_space_size=4096' + YARN_ENABLE_IMMUTABLE_INSTALLS: false + e2e-wby-cms-ddb-es-project-setup: + needs: e2e-wby-cms-ddb-es-constants + name: E2E (DDB-ES) - Project setup + outputs: + cypress-config: ${{ steps.save-cypress-config.outputs.cypress-config }} + environment: next + env: + NODE_OPTIONS: '--max_old_space_size=4096' + YARN_ENABLE_IMMUTABLE_INSTALLS: false + CYPRESS_MAILOSAUR_API_KEY: ${{ secrets.CYPRESS_MAILOSAUR_API_KEY }} + PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }} + PULUMI_SECRETS_PROVIDER: ${{ secrets.PULUMI_SECRETS_PROVIDER }} + WEBINY_PULUMI_BACKEND: ${{ needs.e2e-wby-cms-ddb-es-constants.outputs.pulumi-backend-url }} + AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_ELASTIC_SEARCH_DOMAIN_NAME }} + ELASTIC_SEARCH_ENDPOINT: ${{ secrets.ELASTIC_SEARCH_ENDPOINT }} + ELASTIC_SEARCH_INDEX_PREFIX: ${{ github.run_id }}_ + steps: + - uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::726952677045:role/GitHubActionsWebinyJs + aws-region: eu-central-1 + - uses: actions/checkout@v4 + with: + path: checked-out-pr + - name: Install Hub Utility + run: sudo apt-get install -y hub + - name: Checkout Pull Request + working-directory: checked-out-pr + run: hub pr checkout ${{ github.event.issue.number }} + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - uses: actions/cache@v4 + with: + path: checked-out-pr/.yarn/cache + key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - uses: actions/cache@v4 + with: + path: checked-out-pr/.webiny/cached-packages + key: ${{ needs.e2e-wby-cms-ddb-es-constants.outputs.global-cache-key }} + - name: Install dependencies + working-directory: checked-out-pr + run: yarn --immutable + - name: Build packages + working-directory: checked-out-pr + run: yarn build:quick + - uses: actions/cache@v4 + with: + path: checked-out-pr/.webiny/cached-packages + key: ${{ needs.e2e-wby-cms-ddb-es-constants.outputs.run-cache-key }} + - name: Start Verdaccio local server + working-directory: checked-out-pr + run: >- + yarn add pm2 verdaccio && npx pm2 start verdaccio -- -c + .verdaccio.yaml + - name: Configure NPM to use local registry + run: npm config set registry http://localhost:4873 + - name: Set git email + run: git config --global user.email "webiny-bot@webiny.com" + - name: Set git username + run: git config --global user.name "webiny-bot" + - name: Create ".npmrc" file in the project root, with a dummy auth token + working-directory: checked-out-pr + run: echo '//localhost:4873/:_authToken="dummy-auth-token"' > .npmrc + - name: Version and publish to Verdaccio + working-directory: checked-out-pr + run: yarn release --type=verdaccio + - name: Create verdaccio-files artifact + uses: actions/upload-artifact@v4 + with: + name: verdaccio-files-ddb-es + retention-days: 1 + path: | + checked-out-pr/.verdaccio/ + checked-out-pr/.verdaccio.yaml + - name: Disable Webiny telemetry + run: > + mkdir ~/.webiny && echo '{ "id": "ci", "telemetry": false }' > + ~/.webiny/config + - name: Create a new Webiny project + run: > + npx create-webiny-project@local-npm new-webiny-project --tag local-npm + --no-interactive --assign-to-yarnrc + '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' + --template-options '{"region":"${{ env.AWS_REGION + }}","storageOperations":"ddb-es"}' + - name: Print CLI version + working-directory: new-webiny-project + run: yarn webiny --version + - name: Create project-files artifact + uses: actions/upload-artifact@v4 + with: + name: project-files-ddb-es + retention-days: 1 + path: |- + new-webiny-project/ + !new-webiny-project/node_modules/**/* + !new-webiny-project/**/node_modules/**/* + !new-webiny-project/.yarn/cache/**/* + - name: Deploy Core + working-directory: new-webiny-project + run: yarn webiny deploy apps/core --env dev + - name: Deploy API + working-directory: new-webiny-project + run: yarn webiny deploy apps/api --env dev + - name: Deploy Admin Area + working-directory: new-webiny-project + run: yarn webiny deploy apps/admin --env dev + - name: Deploy Website + working-directory: new-webiny-project + run: yarn webiny deploy apps/website --env dev + - name: Create Cypress config + working-directory: checked-out-pr + run: yarn setup-cypress --projectFolder ../new-webiny-project + - name: Save Cypress config + id: save-cypress-config + working-directory: checked-out-pr + run: >- + echo "cypress-config=$(cat cypress-tests/cypress.config.ts | tr -d + '\t\n\r')" >> $GITHUB_OUTPUT + - name: Cypress - run installation wizard test + working-directory: checked-out-pr + run: >- + yarn cy:run --browser chrome --spec + "cypress/e2e/adminInstallation/**/*.cy.js" + runs-on: ubuntu-latest + permissions: + id-token: write + e2e-wby-cms-ddb-es-cypress-tests: + name: >- + ${{ matrix.cypress-folder }} (ddb-es, ${{ matrix.os }}, Node v${{ + matrix.node }}) + needs: + - e2e-wby-cms-ddb-es-constants + - e2e-wby-cms-ddb-es-project-setup + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + node: + - 18 + cypress-folder: >- + ${{ + fromJson(needs.e2e-wby-cms-ddb-es-constants.outputs.cypress-folders) + }} + environment: next + env: + NODE_OPTIONS: '--max_old_space_size=4096' + YARN_ENABLE_IMMUTABLE_INSTALLS: false + CYPRESS_MAILOSAUR_API_KEY: ${{ secrets.CYPRESS_MAILOSAUR_API_KEY }} + PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }} + PULUMI_SECRETS_PROVIDER: ${{ secrets.PULUMI_SECRETS_PROVIDER }} + WEBINY_PULUMI_BACKEND: ${{ needs.e2e-wby-cms-ddb-es-constants.outputs.pulumi-backend-url }} + AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_ELASTIC_SEARCH_DOMAIN_NAME }} + ELASTIC_SEARCH_ENDPOINT: ${{ secrets.ELASTIC_SEARCH_ENDPOINT }} + ELASTIC_SEARCH_INDEX_PREFIX: ${{ github.run_id }}_ + steps: + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/checkout@v4 + with: + path: checked-out-pr + - name: Install Hub Utility + run: sudo apt-get install -y hub + - name: Checkout Pull Request + working-directory: checked-out-pr + run: hub pr checkout ${{ github.event.issue.number }} + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - uses: actions/cache@v4 + with: + path: checked-out-pr/.yarn/cache + key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - uses: actions/cache@v4 + with: + path: checked-out-pr/.webiny/cached-packages + key: ${{ needs.e2e-wby-cms-ddb-es-constants.outputs.run-cache-key }} + - name: Install dependencies + working-directory: checked-out-pr + run: yarn --immutable + - name: Build packages + working-directory: checked-out-pr + run: yarn build:quick + - name: Set up Cypress config + working-directory: checked-out-pr + run: >- + echo '${{ + needs.e2e-wby-cms-ddb-es-project-setup.outputs.cypress-config }}' > + cypress-tests/cypress.config.ts + - name: Cypress - run "${{ matrix.cypress-folder }}" tests + timeout-minutes: 40 + working-directory: checked-out-pr + run: yarn cy:run --browser chrome --spec "${{ matrix.cypress-folder }}" + runs-on: ubuntu-latest + e2e-wby-cms-ddb-os-constants: + needs: checkComment + name: E2E (DDB-OS) - Constants + outputs: + global-cache-key: ${{ steps.global-cache-key.outputs.global-cache-key }} + run-cache-key: ${{ steps.run-cache-key.outputs.run-cache-key }} + cypress-folders: ${{ steps.list-cypress-folders.outputs.cypress-folders }} + pulumi-backend-url: ${{ steps.pulumi-backend-url.outputs.pulumi-backend-url }} + steps: + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/checkout@v4 + - name: Install Hub Utility + run: sudo apt-get install -y hub + - name: Checkout Pull Request + working-directory: '' + run: hub pr checkout ${{ github.event.issue.number }} + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Create global cache key + id: global-cache-key + run: >- + echo "global-cache-key=$(hub pr show ${{ github.event.issue.number }} + -f %B)-${{ runner.os }}-$(/bin/date -u "+%m%d")-${{ + vars.RANDOM_CACHE_KEY_SUFFIX }}" >> $GITHUB_OUTPUT + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Create workflow run cache key + id: run-cache-key + run: >- + echo "run-cache-key=${{ github.run_id }}-${{ github.run_attempt }}-${{ + vars.RANDOM_CACHE_KEY_SUFFIX }}" >> $GITHUB_OUTPUT + - name: List Cypress tests folders + id: list-cypress-folders + run: >- + echo "cypress-folders=$(node scripts/listCypressTestsFolders.js)" >> + $GITHUB_OUTPUT + - name: Get Pulumi backend URL + id: get-pulumi-backend-url + run: >- + echo "pulumi-backend-url=${{ secrets.WEBINY_PULUMI_BACKEND }}${{ + github.run_id }}_ddb-os" >> $GITHUB_OUTPUT + runs-on: ubuntu-latest + env: + NODE_OPTIONS: '--max_old_space_size=4096' + YARN_ENABLE_IMMUTABLE_INSTALLS: false + e2e-wby-cms-ddb-os-project-setup: + needs: e2e-wby-cms-ddb-os-constants + name: E2E (DDB-OS) - Project setup + outputs: + cypress-config: ${{ steps.save-cypress-config.outputs.cypress-config }} + environment: next + env: + NODE_OPTIONS: '--max_old_space_size=4096' + YARN_ENABLE_IMMUTABLE_INSTALLS: false + CYPRESS_MAILOSAUR_API_KEY: ${{ secrets.CYPRESS_MAILOSAUR_API_KEY }} + PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }} + PULUMI_SECRETS_PROVIDER: ${{ secrets.PULUMI_SECRETS_PROVIDER }} + WEBINY_PULUMI_BACKEND: ${{ needs.e2e-wby-cms-ddb-os-constants.outputs.pulumi-backend-url }} + AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_OPEN_SEARCH_DOMAIN_NAME }} + ELASTIC_SEARCH_ENDPOINT: ${{ secrets.OPEN_SEARCH_ENDPOINT }} + ELASTIC_SEARCH_INDEX_PREFIX: ${{ github.run_id }}_ + steps: + - uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::726952677045:role/GitHubActionsWebinyJs + aws-region: eu-central-1 + - uses: actions/checkout@v4 + with: + path: checked-out-pr + - name: Install Hub Utility + run: sudo apt-get install -y hub + - name: Checkout Pull Request + working-directory: checked-out-pr + run: hub pr checkout ${{ github.event.issue.number }} + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - uses: actions/cache@v4 + with: + path: checked-out-pr/.yarn/cache + key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - uses: actions/cache@v4 + with: + path: checked-out-pr/.webiny/cached-packages + key: ${{ needs.e2e-wby-cms-ddb-os-constants.outputs.global-cache-key }} + - name: Install dependencies + working-directory: checked-out-pr + run: yarn --immutable + - name: Build packages + working-directory: checked-out-pr + run: yarn build:quick + - uses: actions/cache@v4 + with: + path: checked-out-pr/.webiny/cached-packages + key: ${{ needs.e2e-wby-cms-ddb-os-constants.outputs.run-cache-key }} + - name: Start Verdaccio local server + working-directory: checked-out-pr + run: >- + yarn add pm2 verdaccio && npx pm2 start verdaccio -- -c + .verdaccio.yaml + - name: Configure NPM to use local registry + run: npm config set registry http://localhost:4873 + - name: Set git email + run: git config --global user.email "webiny-bot@webiny.com" + - name: Set git username + run: git config --global user.name "webiny-bot" + - name: Create ".npmrc" file in the project root, with a dummy auth token + working-directory: checked-out-pr + run: echo '//localhost:4873/:_authToken="dummy-auth-token"' > .npmrc + - name: Version and publish to Verdaccio + working-directory: checked-out-pr + run: yarn release --type=verdaccio + - name: Create verdaccio-files artifact + uses: actions/upload-artifact@v4 + with: + name: verdaccio-files-ddb-os + retention-days: 1 + path: | + checked-out-pr/.verdaccio/ + checked-out-pr/.verdaccio.yaml + - name: Disable Webiny telemetry + run: > + mkdir ~/.webiny && echo '{ "id": "ci", "telemetry": false }' > + ~/.webiny/config + - name: Create a new Webiny project + run: > + npx create-webiny-project@local-npm new-webiny-project --tag local-npm + --no-interactive --assign-to-yarnrc + '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' + --template-options '{"region":"${{ env.AWS_REGION + }}","storageOperations":"ddb-os"}' + - name: Print CLI version + working-directory: new-webiny-project + run: yarn webiny --version + - name: Create project-files artifact + uses: actions/upload-artifact@v4 + with: + name: project-files-ddb-os + retention-days: 1 + path: |- + new-webiny-project/ + !new-webiny-project/node_modules/**/* + !new-webiny-project/**/node_modules/**/* + !new-webiny-project/.yarn/cache/**/* + - name: Deploy Core + working-directory: new-webiny-project + run: yarn webiny deploy apps/core --env dev + - name: Deploy API + working-directory: new-webiny-project + run: yarn webiny deploy apps/api --env dev + - name: Deploy Admin Area + working-directory: new-webiny-project + run: yarn webiny deploy apps/admin --env dev + - name: Deploy Website + working-directory: new-webiny-project + run: yarn webiny deploy apps/website --env dev + - name: Create Cypress config + working-directory: checked-out-pr + run: yarn setup-cypress --projectFolder ../new-webiny-project + - name: Save Cypress config + id: save-cypress-config + working-directory: checked-out-pr + run: >- + echo "cypress-config=$(cat cypress-tests/cypress.config.ts | tr -d + '\t\n\r')" >> $GITHUB_OUTPUT + - name: Cypress - run installation wizard test + working-directory: checked-out-pr + run: >- + yarn cy:run --browser chrome --spec + "cypress/e2e/adminInstallation/**/*.cy.js" + runs-on: ubuntu-latest + permissions: + id-token: write + e2e-wby-cms-ddb-os-cypress-tests: + name: >- + ${{ matrix.cypress-folder }} (ddb-os, ${{ matrix.os }}, Node v${{ + matrix.node }}) + needs: + - e2e-wby-cms-ddb-os-constants + - e2e-wby-cms-ddb-os-project-setup + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + node: + - 18 + cypress-folder: >- + ${{ + fromJson(needs.e2e-wby-cms-ddb-os-constants.outputs.cypress-folders) + }} + environment: next + env: + NODE_OPTIONS: '--max_old_space_size=4096' + YARN_ENABLE_IMMUTABLE_INSTALLS: false + CYPRESS_MAILOSAUR_API_KEY: ${{ secrets.CYPRESS_MAILOSAUR_API_KEY }} + PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }} + PULUMI_SECRETS_PROVIDER: ${{ secrets.PULUMI_SECRETS_PROVIDER }} + WEBINY_PULUMI_BACKEND: ${{ needs.e2e-wby-cms-ddb-os-constants.outputs.pulumi-backend-url }} + AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_OPEN_SEARCH_DOMAIN_NAME }} + ELASTIC_SEARCH_ENDPOINT: ${{ secrets.OPEN_SEARCH_ENDPOINT }} + ELASTIC_SEARCH_INDEX_PREFIX: ${{ github.run_id }}_ + steps: + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/checkout@v4 + with: + path: checked-out-pr + - name: Install Hub Utility + run: sudo apt-get install -y hub + - name: Checkout Pull Request + working-directory: checked-out-pr + run: hub pr checkout ${{ github.event.issue.number }} + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - uses: actions/cache@v4 + with: + path: checked-out-pr/.yarn/cache + key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - uses: actions/cache@v4 + with: + path: checked-out-pr/.webiny/cached-packages + key: ${{ needs.e2e-wby-cms-ddb-os-constants.outputs.run-cache-key }} + - name: Install dependencies + working-directory: checked-out-pr + run: yarn --immutable + - name: Build packages + working-directory: checked-out-pr + run: yarn build:quick + - name: Set up Cypress config + working-directory: checked-out-pr + run: >- + echo '${{ + needs.e2e-wby-cms-ddb-os-project-setup.outputs.cypress-config }}' > + cypress-tests/cypress.config.ts + - name: Cypress - run "${{ matrix.cypress-folder }}" tests + timeout-minutes: 40 + working-directory: checked-out-pr run: yarn cy:run --browser chrome --spec "${{ matrix.cypress-folder }}" runs-on: ubuntu-latest diff --git a/.github/workflows/wac/pullRequestsCommandCypress.wac.ts b/.github/workflows/wac/pullRequestsCommandCypress.wac.ts index 8ff515b477a..357df3505d3 100644 --- a/.github/workflows/wac/pullRequestsCommandCypress.wac.ts +++ b/.github/workflows/wac/pullRequestsCommandCypress.wac.ts @@ -4,8 +4,7 @@ import { NODE_OPTIONS, NODE_VERSION } from "./utils"; import { createJob, createValidateWorkflowsJob } from "./jobs"; const DIR_PR = "checked-out-pr"; -const DIR_NPX_CWP = "npx-cwp"; -const DIR_NEW_WEBINY_PROJECT = DIR_NPX_CWP + "/new-webiny-project"; +const DIR_TEST_PROJECT = "new-webiny-project"; const createCheckoutPrSteps = ({ workingDirectory = "" } = {}) => [ @@ -160,19 +159,14 @@ const createJobs = (dbSetup: string) => { name: "Disable Webiny telemetry", run: 'mkdir ~/.webiny && echo \'{ "id": "ci", "telemetry": false }\' > ~/.webiny/config\n' }, - { - name: "Create directory", - run: "mkdir " + DIR_NPX_CWP - }, { name: "Create a new Webiny project", - "working-directory": DIR_NPX_CWP, - run: `npx create-webiny-project@local-npm test-project --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' --template-options '{"region":"\${{ env.AWS_REGION }}","storageOperations":"${dbSetup}"}' + run: `npx create-webiny-project@local-npm ${DIR_TEST_PROJECT} --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' --template-options '{"region":"\${{ env.AWS_REGION }}","storageOperations":"${dbSetup}"}' ` }, { name: "Print CLI version", - "working-directory": DIR_NEW_WEBINY_PROJECT, + "working-directory": DIR_TEST_PROJECT, run: "yarn webiny --version" }, { @@ -182,18 +176,18 @@ const createJobs = (dbSetup: string) => { name: `project-files-${dbSetup}`, "retention-days": 1, path: [ - `${DIR_NEW_WEBINY_PROJECT}/`, - `!${DIR_NEW_WEBINY_PROJECT}/node_modules/**/*`, - `!${DIR_NEW_WEBINY_PROJECT}/**/node_modules/**/*`, - `!${DIR_NEW_WEBINY_PROJECT}/.yarn/cache/**/*` + `${DIR_TEST_PROJECT}/`, + `!${DIR_TEST_PROJECT}/node_modules/**/*`, + `!${DIR_TEST_PROJECT}/**/node_modules/**/*`, + `!${DIR_TEST_PROJECT}/.yarn/cache/**/*` ].join("\n") } }, - ...createDeployWebinySteps({ workingDirectory: DIR_NEW_WEBINY_PROJECT }), + ...createDeployWebinySteps({ workingDirectory: DIR_TEST_PROJECT }), { name: "Create Cypress config", "working-directory": DIR_PR, - run: `yarn setup-cypress --projectFolder ../${DIR_NEW_WEBINY_PROJECT}` + run: `yarn setup-cypress --projectFolder ../${DIR_TEST_PROJECT}` }, { name: "Save Cypress config", @@ -245,6 +239,7 @@ const createJobs = (dbSetup: string) => { { name: 'Cypress - run "${{ matrix.cypress-folder }}" tests', "timeout-minutes": 40, + "working-directory": DIR_PR, run: 'yarn cy:run --browser chrome --spec "${{ matrix.cypress-folder }}"' } ] @@ -294,8 +289,8 @@ export const pullRequestsCommandCypressTest = createWorkflow({ } ] }), - ...createJobs("ddb") - // ...createJobs("ddb-es"), - // ...createJobs("ddb-os") + ...createJobs("ddb"), + ...createJobs("ddb-es"), + ...createJobs("ddb-os") } });