Skip to content

Extract logic from application-shell to application-shell-connector package #9320

Extract logic from application-shell to application-shell-connector package

Extract logic from application-shell to application-shell-connector package #9320

Workflow file for this run

name: Main workflow
# The event triggers are configured as following:
# - on branch main, trigger the workflow on every push
# - on any pull request, trigger the workflow
# This is to avoid running the workflow twice on pull requests.
on:
push:
branches:
- main
pull_request:
jobs:
lint_and_test:
runs-on: ubuntu-latest
timeout-minutes: 15
# https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L8-L11
env:
# prevents extra Cypress installation progress messages
CI: 1
# avoid warnings like "tput: No value for $TERM and no -T specified"
TERM: xterm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing dependencies and building packages
uses: ./.github/actions/ci
- name: Running static type checking
run: pnpm typecheck
- name: Running static type checking (Cypress)
run: pnpm typecheck:cypress
- name: Running static type checking (Starter Template)
run: pnpm typecheck:starters
- name: Running linters and tests
run: pnpm jest --projects jest.{eslint,stylelint,test,text}.config.js --reporters jest-silent-reporter
env:
CI: true
RTL_ASYNC_UTIL_TIMEOUT: 5000
test_visual:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing dependencies and building packages
uses: ./.github/actions/ci
- name: Building Visual Regression Tests application for UI components
run: pnpm visual-testing-app:build
# Explicitly install the Chrome binary in case it's not available yet.
# This workaround is based on the suggestions from https://github.com/puppeteer/puppeteer/issues/9533.
- name: Installing Chrome via Puppeteer
run: node ./node_modules/puppeteer/install.js
- name: Running Visual Regression Tests for UI components
run: pnpm vrt:components
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_UI_COMPONENTS }}
test_starter_template:
runs-on: ubuntu-latest
timeout-minutes: 15
# https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L8-L11
env:
# prevents extra Cypress installation progress messages
CI: 1
# avoid warnings like "tput: No value for $TERM and no -T specified"
TERM: xterm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing dependencies and building packages
uses: ./.github/actions/ci
- name: Testing Starter application development server
run: pnpm start-server-and-test 'pnpm template-starter:start' http-get://127.0.0.1:3001 'exit 0'
env:
HOST_GCP_STAGING: ${{ secrets.HOST_GCP_STAGING }}
APP_ID: ${{ secrets.APP_ID_PLAYGROUND }}
MC_API_URL: ${{ secrets.MC_API_URL }}
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
- name: Building Starter template application
run: pnpm template-starter:build
env:
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
# https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L23-L30
# https://github.com/marketplace/actions/cypress-io#custom-install
- name: Restoring Cypress cache
# restore / cache the binary ourselves on Linux
# see https://github.com/actions/cache
id: cache-cypress
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('**/package.json') }}
- name: Installing Cypress binary
run: pnpm cypress install && pnpm cypress cache list
- name: Running End-to-End tests for Starter template application
run: pnpm start-server-and-test 'pnpm template-starter:start:prod:local' http-get://127.0.0.1:3001 'pnpm test:e2e:template-starter'
env:
NODE_ENV: test
CYPRESS_CI: "true"
CYPRESS_LOGIN_USER: ${{ secrets.CYPRESS_LOGIN_USER }}
CYPRESS_LOGIN_PASSWORD: ${{ secrets.CYPRESS_LOGIN_PASSWORD }}
CYPRESS_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
HOST_GCP_STAGING: ${{ secrets.HOST_GCP_STAGING }}
APP_ID: ${{ secrets.APP_ID_PLAYGROUND }}
MC_API_URL: ${{ secrets.MC_API_URL }}
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
test_starter_template_installation:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' && github.head_ref != 'changeset-release/main'
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing dependencies and building packages
uses: ./.github/actions/ci
- name: Installing and building template starter
run: node ./scripts/install-template.mjs
env:
TEMPLATE_NAME: starter
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
test_starter_template_typescript:
runs-on: ubuntu-latest
timeout-minutes: 15
# https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L8-L11
env:
# prevents extra Cypress installation progress messages
CI: 1
# avoid warnings like "tput: No value for $TERM and no -T specified"
TERM: xterm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing dependencies and building packages
uses: ./.github/actions/ci
- name: Testing Starter application development server
run: pnpm start-server-and-test 'pnpm template-starter-typescript:start' http-get://127.0.0.1:3001 'exit 0'
env:
HOST_GCP_STAGING: ${{ secrets.HOST_GCP_STAGING }}
APP_ID: ${{ secrets.APP_ID_PLAYGROUND }}
MC_API_URL: ${{ secrets.MC_API_URL }}
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
- name: Building Starter template application
run: pnpm template-starter-typescript:build
env:
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
- name: Running static type checking
run: pnpm typecheck:starter:custom-applications
# https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L23-L30
# https://github.com/marketplace/actions/cypress-io#custom-install
- name: Restoring Cypress cache
# restore / cache the binary ourselves on Linux
# see https://github.com/actions/cache
id: cache-cypress
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('**/package.json') }}
- name: Installing Cypress binary
run: pnpm cypress install && pnpm cypress cache list
- name: Running End-to-End tests for Starter template application
run: pnpm start-server-and-test 'pnpm template-starter-typescript:start:prod:local' http-get://127.0.0.1:3001 'pnpm test:e2e:template-starter'
env:
NODE_ENV: test
CYPRESS_CI: "true"
CYPRESS_LOGIN_USER: ${{ secrets.CYPRESS_LOGIN_USER }}
CYPRESS_LOGIN_PASSWORD: ${{ secrets.CYPRESS_LOGIN_PASSWORD }}
CYPRESS_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
HOST_GCP_STAGING: ${{ secrets.HOST_GCP_STAGING }}
APP_ID: ${{ secrets.APP_ID_PLAYGROUND }}
MC_API_URL: ${{ secrets.MC_API_URL }}
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
test_starter_template_typescript_installation:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' && github.head_ref != 'changeset-release/main'
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing dependencies and building packages
uses: ./.github/actions/ci
- name: Installing and building template starter
run: node ./scripts/install-template.mjs
env:
TEMPLATE_NAME: starter-typescript
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
test_playground:
runs-on: ubuntu-latest
timeout-minutes: 15
# https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L8-L11
env:
# prevents extra Cypress installation progress messages
CI: 1
# avoid warnings like "tput: No value for $TERM and no -T specified"
TERM: xterm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing dependencies and building packages
uses: ./.github/actions/ci
- name: Building Playground application
run: pnpm playground:build
env:
NODE_OPTIONS: '--max-old-space-size=6144'
APP_ID: ${{ secrets.APP_ID_PLAYGROUND }}
MC_API_URL: ${{ secrets.MC_API_URL }}
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
HOST_GCP_STAGING: ${{ secrets.HOST_GCP_STAGING }}
# https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L23-L30
# https://github.com/marketplace/actions/cypress-io#custom-install
- name: Restoring Cypress cache
# restore / cache the binary ourselves on Linux
# see https://github.com/actions/cache
id: cache-cypress
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('**/package.json') }}
- name: Installing Cypress binary
run: pnpm cypress install && pnpm cypress cache list
- name: Running End-to-End tests for Playground application
run: pnpm start-server-and-test 'pnpm playground:start:prod:local' http-get://127.0.0.1:3001 'pnpm percy exec -- pnpm test:e2e:playground'
env:
NODE_ENV: test
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_E2E_PLAYGROUND }}
CYPRESS_CI: "true"
CYPRESS_LOGIN_USER: ${{ secrets.CYPRESS_LOGIN_USER }}
CYPRESS_LOGIN_PASSWORD: ${{ secrets.CYPRESS_LOGIN_PASSWORD }}
CYPRESS_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}
HOST_GCP_STAGING: ${{ secrets.HOST_GCP_STAGING }}
APP_ID: ${{ secrets.APP_ID_PLAYGROUND }}
MC_API_URL: ${{ secrets.MC_API_URL }}
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }}