Skip to content

chore: Cypress skip tests #31

chore: Cypress skip tests

chore: Cypress skip tests #31

Workflow file for this run

name: Test Workflow
on:
# Triggers the workflow on push events
push:
branches:
- development
# Triggers the workflow on pull request events
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GITHUB_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }}
IS_DEV: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/development' }}
jobs:
test-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
fetch-depth: 0
- uses: ./.github/actions/init
- name: Format
run: npx nx format:check --verbose
test-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
fetch-depth: 0
- uses: ./.github/actions/init
- name: Lint
uses: ./.github/actions/run-optimal
with:
cmd: npx nx run-many --target=lint --all --parallel=2
affectedCmd: npx nx affected:lint
isDev: ${{ env.IS_DEV }}
test-stylelint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
fetch-depth: 0
- uses: ./.github/actions/init
- name: Style Lint All
uses: ./.github/actions/run-optimal
with:
cmd: npx nx run-many --target=stylelint --all --parallel=2
affectedCmd: npx nx affected --target=stylelint
isDev: ${{ env.IS_DEV }}
test-tsconfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
fetch-depth: 0
- uses: ./.github/actions/init
- name: TsConfig Paths
uses: ./.github/actions/run-optimal
with:
cmd: npx nx run-many --target=paths --all --parallel=2
affectedCmd: npx nx affected --target=paths
isDev: ${{ env.IS_DEV }}
test-unit:
runs-on: ubuntu-latest
needs: [test-format, test-lint, test-stylelint, test-tsconfig]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
fetch-depth: 0
- uses: ./.github/actions/init
- name: Unit Tests
uses: ./.github/actions/run-optimal
with:
cmd: |
npx nx run-many --target=test --all --parallel=2
node tools/coverage-reports/create-merged-layer-coverage-report.js libs/base
node tools/coverage-reports/create-merged-layer-coverage-report.js libs/domain
node tools/coverage-reports/create-merged-layer-coverage-report.js libs/platform
affectedCmd: npx nx affected:test
isDev: ${{ env.IS_DEV }}
test-visual-pr:
runs-on: ubuntu-latest
needs: [test-format, test-lint, test-stylelint, test-tsconfig]
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: ./.github/actions/init
- name: Visual Regression Tests
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
CHROMATIC_SHA: ${{ github.event.pull_request.head.sha }}
CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref }}
run: npx nx run storybook:visual-regression-pr
test-visual-dev:
runs-on: ubuntu-latest
needs: [test-format, test-lint, test-stylelint, test-tsconfig]
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
fetch-depth: 0
- uses: ./.github/actions/init
- name: Visual Regression Tests
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
CHROMATIC_SHA: ${{ github.event.after }}
CHROMATIC_BRANCH: development
run: npx nx run storybook:visual-regression-branch
test-e2e-storefront:
runs-on: ubuntu-latest
needs: [test-format, test-lint, test-stylelint, test-tsconfig]
# # Commented out while we are still having long unit test runs
# strategy:
# matrix:
# os: [ubuntu-latest]
# parallelism: [1, 2, 3]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
fetch-depth: 0
- uses: ./.github/actions/init
- name: Storefront E2E Tests
uses: ./.github/actions/run-optimal
env:
SCOS_BASE_URL: ${{ secrets.SCOS_BASE_URL }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
STORE: DE
ORYX_FEATURE_VERSION: latest
with:
cmd: npm run sf:e2e:headless:ci
affectedCmd: npm run sf:e2e:headless:ci:affected
isDev: ${{ env.IS_DEV }}
test-storefront-visual-regression:
runs-on: ubuntu-latest
needs: [test-format, test-lint, test-stylelint, test-tsconfig]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
fetch-depth: 0
- uses: ./.github/actions/init
- name: Storefront B2C visual regression tests
uses: ./.github/actions/run-optimal
env:
SCOS_BASE_URL: ${{ secrets.SCOS_BASE_URL }}
STORE: DE
ORYX_FEATURE_VERSION: latest
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
PERCY_BRANCH: ${{ github.head_ref || github.ref_name }}
with:
cmd: npm run sf:e2e:headless:ci:visual-regression
affectedCmd: npm run sf:e2e:headless:ci:visual-regression
isDev: ${{ env.IS_DEV }}
test-build:
runs-on: ubuntu-latest
needs: [test-format, test-lint, test-stylelint, test-tsconfig]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
fetch-depth: 0
- uses: ./.github/actions/init
- name: Build
uses: ./.github/actions/run-optimal
with:
cmd: npx nx run-many --target=build --all --parallel=2
affectedCmd: npx nx affected:build
isDev: ${{ env.IS_DEV }}