Skip to content

Hds 1672 skip link #3596

Hds 1672 skip link

Hds 1672 skip link #3596

Workflow file for this run

name: development
on:
pull_request:
push:
branches:
- development
- master
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Read .nvmrc
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvmrc
- name: setup node ${{ steps.nvmrc.outputs.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvmrc.outputs.NODE_VERSION }}'
registry-url: 'https://registry.npmjs.org'
- name: install dependencies
run: |
yarn config set network-timeout 300000
yarn
- name: build design tokens package
run: yarn build
working-directory: ./packages/design-tokens
- name: build core package
run: yarn build
working-directory: ./packages/core
- name: build react package
run: yarn build
working-directory: ./packages/react
- name: test react package
run: yarn test
working-directory: ./packages/react
- name: build storybook for react
if: ${{ !(contains(github.head_ref, 'hotfix') || contains(github.ref, 'hotfix')) }}
run: yarn build-storybook
working-directory: ./packages/react
- name: Store storybook as artifact
if: ${{ !(contains(github.head_ref, 'hotfix') || contains(github.ref, 'hotfix')) }}
uses: actions/upload-artifact@v2
with:
name: storybook-${{ github.sha }}
path: |
packages/react/.loki
packages/react/storybook-static
packages/react/.lokirc.json
retention-days: 1
visual-tests:
needs: build-test
# No visual testing in hotfixes
if: ${{ !(contains(github.head_ref, 'hotfix') || contains(github.ref, 'hotfix')) }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
loki_configuration: ['laptop', 'iphone7']
loki_test_group: ['Components/[A-M]', 'Components/[N-Z]']
steps:
- name: download storybook
uses: actions/download-artifact@v2
with:
name: storybook-${{ github.sha }}
- name: install dependencies for visual testing
run: |
sudo apt update
sudo apt install graphicsmagick -y
yarn add [email protected]
- name: Sanitize artifact name. Backslash not allowed
id: sanitize_artifact_name
run: echo ::set-output name=value::$(echo '${{ matrix.loki_test_group }}' | tr '/' '_')
- name: visually test react package with ${{ matrix.loki_configuration }}
run: ./node_modules/.bin/loki test --requireReference --verboseRenderer --reactUri file:./storybook-static --storiesFilter ${{ matrix.loki_test_group }} ${{ matrix.loki_configuration }}
- name: upload reference and actual images with ${{ matrix.loki_configuration }} and ${{ matrix.loki_test_group }} in case of failure
uses: actions/upload-artifact@v2
with:
name: loki_images_${{ matrix.loki_configuration }}_${{ steps.sanitize_artifact_name.outputs.value }}
path: .loki/difference/*.*
if: failure()