bbc/psammead

View on GitHub
.github/workflows/psammead-chromaticqa.yml

Summary

Maintainability
Test Coverage
name: Psammead CI - Chromatic UI
on:
  create:
    branches:
      - '**'
  pull_request:
    branches:
      - '**'
  push:
    branches:
      - latest
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: ['12']
    env:
      CI: true

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'

      - uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}

      - name: Get Changed Files
        id: changedFiles
        uses: jitterbit/get-changed-files@v1

      - name: Install Node Modules
        if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'bbc/psammead') && contains(steps.changedFiles.outputs.all, 'packages')
        run: ./scripts/installNodeModules.sh

      - name: Chromatic UI Tests
        if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'bbc/psammead') && contains(steps.changedFiles.outputs.all, 'packages')
        uses: chromaui/action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          projectToken: ${{ secrets.CHROMATIC_APP_CODE }}
          buildScriptName: 'build:storybook'
          exitOnceUploaded: true