chore: Storybook (#4700)

[skip ci]
This commit is contained in:
Jamie 2022-07-29 16:23:04 +01:00 committed by GitHub
commit d5e85ffdac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 8654 additions and 2231 deletions

47
.github/workflows/chromatic.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: 'Chromatic'
# Event for the workflow
on:
push:
workflow_dispatch:
# List of jobs
jobs:
storybook-build:
# Operating System
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: NodeModules Cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: node_modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
working-directory: ./src/Ombi/ClientApp
run: yarn
- name: Publish to Chromatic
if: github.ref != 'refs/heads/master'
uses: chromaui/action@v1
with:
projectToken: 7c47e1a1a4bd
exitZeroOnChanges: true
workingDir: ./src/Ombi/ClientApp
buildScriptName: storybookbuild
exitOnceUploaded: true
- name: Publish to Chromatic and auto accept changes
if: github.ref == 'refs/heads/master'
uses: chromaui/action@v1
with:
projectToken: 7c47e1a1a4bd
autoAcceptChanges: true # 👈 Option to accept all changes
workingDir: ./src/Ombi/ClientApp
buildScriptName: storybookbuild
exitOnceUploaded: true

View file

@ -34,15 +34,17 @@ jobs:
- name: Install Frontend Deps
run: yarn --cwd ./src/Ombi/ClientApp install
- name: Start Frontend
run: |
nohup yarn --cwd ./src/Ombi/ClientApp start &
- name: Install Automation Deps
run: yarn --cwd ./tests install
- name: Start Backend
run: |
nohup dotnet run --project ./src/Ombi -- --host http://*:3577 &
- name: Start Frontend
run: |
nohup yarn --cwd ./src/Ombi/ClientApp start &
- name: Cypress Tests
uses: cypress-io/github-action@v2.8.2
with:
@ -51,8 +53,8 @@ jobs:
headless: true
working-directory: tests
wait-on: http://localhost:3577/
# 7 minutes
wait-on-timeout: 420
# 10 minutes
wait-on-timeout: 600
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}