Skip to content

Commit

Permalink
ci: Use reg-actions for visual regression testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzWeber0 committed Sep 14, 2024
1 parent 62eb891 commit 5f9d43b
Showing 5 changed files with 17,102 additions and 12,745 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -16,6 +16,26 @@ on:
- '.github/workflows/storybook.yml'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: npm install storycap puppeteer http-server
working-directory: ./frontend
- name: Build Storybook
run: npx -p @angular/cli ng run capellacollab:build-storybook
working-directory: ./frontend
- name: Capture screenshots
run:
storycap --serverCmd "npx http-server storybook-static -p 9001"
http://localhost:9001
working-directory: ./frontend
- uses: reg-viz/reg-actions@v2
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
image-directory-path: './frontend/__screenshots__'

chromatic:
runs-on: ubuntu-latest
# prettier-ignore
@@ -54,16 +74,12 @@ jobs:
- name: Install dependencies
run: npm ci
working-directory: ./frontend
- name: Build Storybook
run: npx -p @angular/cli ng run capellacollab:build-storybook
working-directory: ./frontend
- name: Run Chromatic
id: chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: ./frontend
storybookBuildDir: ./storybook-static
onlyChanged: true
- name: Create Storybook comment (initial)
if: github.event_name == 'pull_request'
2 changes: 2 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -64,3 +64,5 @@ storybook-static
documentation.json

.nx

__screenshots__
2 changes: 0 additions & 2 deletions frontend/angular.json
Original file line number Diff line number Diff line change
@@ -163,8 +163,6 @@
"builder": "@storybook/angular:build-storybook",
"options": {
"configDir": ".storybook",
"webpackStatsJson": true,

"browserTarget": "capellacollab:build:storybook",
"compodoc": true,
"compodocArgs": ["-e", "json", "-d", "."],
Loading

0 comments on commit 5f9d43b

Please sign in to comment.