From 38e428c2d4b938e747fe348a721cf40bb6b88f61 Mon Sep 17 00:00:00 2001 From: wesleybl Date: Mon, 18 Mar 2024 13:02:28 -0300 Subject: [PATCH] Test core volto slate with prefixed site --- .github/workflows/acceptance.yml | 85 ++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index 21cb295404..ab36cf1942 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -1652,6 +1652,91 @@ jobs: name: cypress-videos path: packages/volto/cypress/videos + prefix-corevoltoslate: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + name: Core Volto Slate Prefixed Site + runs-on: ubuntu-latest + timeout-minutes: 35 + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v4 + + # node setup + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + # pnpm install + - uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Cache Cypress Binary + id: cache-cypress-binary + uses: actions/cache@v4 + with: + path: ~/.cache/Cypress + key: binary-${{ matrix.node-version }}-${{ hashFiles('pnpm-lock.yaml') }} + + - run: pnpm i + + - name: Install Cypress if not in cache + if: steps.cache-cypress-binary.outputs.cache-hit != 'true' + working-directory: packages/volto + run: make cypress-install + + - name: Cypress acceptance tests + uses: cypress-io/github-action@v6 + env: + BABEL_ENV: production + CYPRESS_RETRIES: 2 + # Recommended: pass the GitHub token lets this action correctly + # determine the unique run id necessary to re-run the checks + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + install: false + working-directory: packages/volto + browser: chrome + spec: cypress/tests/core/volto-slate/**/*.js + config: baseUrl=http://localhost/foo + env: prefixPath=/foo + start: | + make start-test-acceptance-server + make start-test-acceptance-frontend-prefixed + make start-test-acceptance-webserver-prefixed + wait-on: 'npx wait-on --httpTimeout 20000 http-get://127.0.0.1:55001/plone http://127.0.0.1:3000/foo http://localhost/foo' + + # Upload Cypress screenshots + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: cypress-screenshots + path: packages/volto/cypress/screenshots + # Upload Cypress videos + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: cypress-videos + path: packages/volto/cypress/videos + multilingualprefix: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: Multilingual in Prefixed site