🔥 feat(e2e): Filling out the Web Vanilla E2E test app #201
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Main Pipeline | |
| # This is a pre-NX workflow. Format, linting, type safety and unit tests are run for all | |
| # publishable packages. | |
| # | |
| # NX integration and/or other optimizations will happen separately. | |
| on: | |
| pull_request: | |
| jobs: | |
| setup: | |
| name: pnpm install 🛠️ | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - uses: actions/cache@v4 | |
| id: node-modules-cache | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| - if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
| run: pnpm i --prefer-offline --frozen-lockfile | |
| license-check: | |
| name: License Check 📄 | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| filters: | | |
| lock: | |
| - 'pnpm-lock.yaml' | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: actions/cache@v4 | |
| if: steps.filter.outputs.lock == 'true' | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| - if: steps.filter.outputs.lock == 'true' | |
| run: > | |
| echo "In case of error, please see ./CONTRIBUTING.md" | |
| pnpx license-checker \ | |
| --summary \ | |
| --production \ | |
| --relativeLicensePath \ | |
| --onlyAllow 'MIT;Apache-2.0;ISC;BSD-3-Clause;BSD-2-Clause;MIT*;Apache 2.0;Unlicense;Unlicensed;:CC0-1.0;CC-BY-4.0;WTFPL;0BSD;UNLICENSED;Python-2.0;MPL-2.0;CC-BY-3.0;CC0-1.0' | |
| format: | |
| name: Format Check 🎨 | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| - run: pnpm i --prefer-offline --frozen-lockfile | |
| - run: pnpm format:check | |
| build: | |
| name: Build 📦 | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| needs: setup | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| - run: pnpm i --prefer-offline --frozen-lockfile | |
| - run: pnpm build | |
| type-check: | |
| name: Type Check 🔷 | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| - run: pnpm i --prefer-offline --frozen-lockfile | |
| - run: pnpm typecheck | |
| lint: | |
| name: Lint 🎨 | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| - run: pnpm i --prefer-offline --frozen-lockfile | |
| - run: pnpm lint:check | |
| test: | |
| name: Test 🧪 | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| needs: setup | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| - run: pnpm i --prefer-offline --frozen-lockfile | |
| - run: pnpm test:unit | |
| e2e-node: | |
| name: E2E Node 🖥️ | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| needs: setup | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - run: | | |
| echo "VITE_NINETAILED_CLIENT_ID=${{secrets.NINETAILED_CLIENT_ID}}" >>implementations/node/.env | |
| echo "VITE_NINETAILED_ENVIRONMENT=${{secrets.NINETAILED_ENVIRONMENT}}" >>implementations/node/.env | |
| echo "VITE_EXPERIENCE_API_BASE_URL=http://localhost/experience/" >>implementations/node/.env | |
| echo "VITE_INSIGHTS_API_BASE_URL=http://localhost/insights/" >>implementations/node/.env | |
| echo "VITE_CONTENTFUL_TOKEN=${{secrets.CONTENTFUL_TOKEN}}" >>implementations/node/.env | |
| echo "VITE_CONTENTFUL_PREVIEW_TOKEN=${{secrets.CONTENTFUL_PREVIEW_TOKEN}}" >>implementations/node/.env | |
| echo "VITE_CONTENTFUL_ENVIRONMENT=${{secrets.CONTENTFUL_ENVIRONMENT}}" >>implementations/node/.env | |
| echo "VITE_CONTENTFUL_SPACE_ID=${{secrets.CONTENTFUL_SPACE_ID}}" >>implementations/node/.env | |
| echo "VITE_CONTENTFUL_CDA_HOST=localhost" >>implementations/node/.env | |
| echo "VITE_CONTENTFUL_BASE_PATH=contentful" >>implementations/node/.env | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| - run: pnpm i --prefer-offline --frozen-lockfile | |
| - run: pnpx playwright install --with-deps | |
| - run: pnpm --filter @implementation/node test:e2e | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: e2e-results | |
| path: | | |
| ./implementations/node/playwright-report/ | |
| ./implementations/node/test-results/ | |
| retention-days: 7 | |
| e2e-web: | |
| name: E2E Web Vanilla 🖥️ | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| needs: setup | |
| steps: | |
| - uses: docker/setup-compose-action@v1 | |
| - uses: actions/checkout@v5 | |
| - run: | | |
| echo "VITE_NINETAILED_CLIENT_ID=${{secrets.NINETAILED_CLIENT_ID}}" >>implementations/web-vanilla/.env | |
| echo "VITE_NINETAILED_ENVIRONMENT=${{secrets.NINETAILED_ENVIRONMENT}}" >>implementations/web-vanilla/.env | |
| echo "VITE_EXPERIENCE_API_BASE_URL=http://localhost:8000/experience/" >>implementations/web-vanilla/.env | |
| echo "VITE_INSIGHTS_API_BASE_URL=http://localhost:8000/insights/" >>implementations/web-vanilla/.env | |
| echo "VITE_CONTENTFUL_TOKEN=${{secrets.CONTENTFUL_TOKEN}}" >>implementations/web-vanilla/.env | |
| echo "VITE_CONTENTFUL_PREVIEW_TOKEN=${{secrets.CONTENTFUL_PREVIEW_TOKEN}}" >>implementations/web-vanilla/.env | |
| echo "VITE_CONTENTFUL_ENVIRONMENT=${{secrets.CONTENTFUL_ENVIRONMENT}}" >>implementations/web-vanilla/.env | |
| echo "VITE_CONTENTFUL_SPACE_ID=${{secrets.CONTENTFUL_SPACE_ID}}" >>implementations/web-vanilla/.env | |
| echo "VITE_CONTENTFUL_CDA_HOST=localhost:8000" >>implementations/web-vanilla/.env | |
| echo "VITE_CONTENTFUL_BASE_PATH=contentful" >>implementations/web-vanilla/.env | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| - run: pnpm i --prefer-offline --frozen-lockfile | |
| - run: pnpx playwright install --with-deps | |
| - run: pnpm --filter @implementation/web-vanilla test:e2e | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: e2e-results | |
| path: | | |
| ./implementations/web-vanilla/playwright-report/ | |
| ./implementations/web-vanilla/test-results/ | |
| retention-days: 7 |