Skip to content

Commit 7b01849

Browse files
authoredNov 21, 2024··
Update autoAccept branch to develop and add comment only on PRs (#11614)
1 parent 731c884 commit 7b01849

File tree

8 files changed

+52
-25
lines changed

8 files changed

+52
-25
lines changed
 

‎.github/workflows/gui-checks.yml

+16-11
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,18 @@ jobs:
7272
continue-on-error: true
7373
run: pnpm run ci:test
7474

75-
- name: 💾 Save cache
76-
uses: actions/cache/save@v4
77-
if: always() && steps.cache.outputs.cache-hit != 'true'
78-
id: save-cache
79-
with:
80-
key: ${{ steps.cache.outputs.cache-primary-key }}
81-
path: |
82-
**/.eslintcache
83-
node_modules/.cache/prettier
84-
8575
- name: 📝 Annotate Code Linting Results
76+
if: always()
77+
continue-on-error: true
8678
uses: ataylorme/eslint-annotate-action@v3
8779
with:
8880
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8981
report-json: "./**/eslint_report.json"
9082
markdown-report-on-step-summary: true
9183
check-name: 🧹 GUI Lint Results
84+
only-pr-files: false
85+
fail-on-error: false
86+
fail-on-warning: false
9287

9388
- name: ❌ Fail if any check failed
9489
if: always() && (steps.prettier.outcome == 'failure' || steps.lint.outcome == 'failure' || steps.typecheck.outcome == 'failure' || steps.unit-tests.outcome == 'failure')
@@ -99,6 +94,16 @@ jobs:
9994
echo "Unit tests outcome: ${{ steps.unit-tests.outcome }}"
10095
exit 1
10196
97+
- name: 💾 Save cache
98+
uses: actions/cache/save@v4
99+
if: always() && steps.cache.outputs.cache-hit != 'true'
100+
id: save-cache
101+
with:
102+
key: ${{ steps.cache.outputs.cache-primary-key }}
103+
path: |
104+
**/.eslintcache
105+
node_modules/.cache/prettier
106+
102107
playwright:
103108
name: 🎭 Playwright Tests
104109
env:
@@ -186,7 +191,7 @@ jobs:
186191

187192
- name: 🔗 Merge into HTML Report
188193
working-directory: app/gui
189-
run: pnpm playwright merge-reports --reporter html ./blob-report
194+
run: pnpm playwright merge-reports --reporter=html,github ./blob-report
190195

191196
- name: ⬆️ Upload HTML report
192197
uses: actions/upload-artifact@v4

‎.github/workflows/gui-pull-request.yml

+15-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ permissions:
2222
jobs:
2323
changed-files:
2424
runs-on: ubuntu-latest
25-
name: 🔍 Detect changed files in GUI
25+
name: 🔍 GUI files changed
2626
outputs:
2727
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
2828
any_changed: ${{ steps.changed-files.outputs.any_changed }}
@@ -43,6 +43,7 @@ jobs:
4343
.prettierrc.js
4444
.prettierignore
4545
vitest.workspace.ts
46+
.github/workflows/gui*
4647
files_ignore: |
4748
app/ide-desktop/**
4849
app/gui/scripts/**
@@ -71,13 +72,24 @@ jobs:
7172
if: ${{ needs.changed-files.outputs.any_changed == 'true' }}
7273
secrets: inherit
7374

75+
print-checks-result:
76+
name: 🤷 Print checks result
77+
runs-on: ubuntu-latest
78+
needs: [checks, storybook]
79+
if: always()
80+
steps:
81+
- name: Print checks result
82+
run: |
83+
echo "Checks: ${{ needs.checks.result }}"
84+
echo "Storybook: ${{ needs.storybook.result }}"
85+
7486
# This job is used to report success if the needed jobs were successful.
7587
# This is a workaround to make optional jobs required if they run
7688
report-success:
77-
name: Success or skipped due to no changes
89+
name: GUI Checks Success or Skipped
7890
runs-on: ubuntu-latest
7991
needs: [checks, storybook]
80-
if: needs.checks.result == 'skipped' && needs.storybook.result == 'skipped' || needs.checks.result == 'success' && needs.storybook.result == 'success'
92+
if: always() && (needs.checks.result == 'skipped' && needs.storybook.result == 'skipped') || (needs.checks.result == 'success' && needs.storybook.result == 'success')
8193
steps:
8294
- name: Report success
8395
run: echo "Success!"

‎.github/workflows/storybook.yml

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
comment-on-pr:
7979
name: 💬 Comment on PR
8080
runs-on: ubuntu-latest
81+
if: github.event_name == 'pull_request'
8182
needs: deploy-chromatic-react
8283
steps:
8384
- uses: actions/checkout@v4

‎app/gui/.storybook/preview.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@
33
*/
44
import type { Preview as ReactPreview } from '@storybook/react'
55
import type { Preview as VuePreview } from '@storybook/vue3'
6-
import React, { useLayoutEffect, useState } from 'react'
6+
import isChromatic from 'chromatic/isChromatic'
7+
import { useLayoutEffect, useState } from 'react'
8+
79
import invariant from 'tiny-invariant'
810
import UIProviders from '../src/dashboard/components/UIProviders'
911

12+
import { MotionGlobalConfig } from 'framer-motion'
1013
import z from 'zod'
1114
import '../src/dashboard/tailwind.css'
1215

16+
if (isChromatic()) {
17+
MotionGlobalConfig.skipAnimations = true
18+
document.documentElement.classList.add('disable-animations')
19+
}
20+
1321
const framework = z.enum(['vue', 'react']).parse(window.ENV.FRAMEWORK)
1422

1523
const vuePreview: VuePreview = {
@@ -32,7 +40,6 @@ const reactPreview: ReactPreview = {
3240
},
3341
},
3442
},
35-
3643
// Decorators for all stories
3744
// Decorators are applied in the reverse order they are defined
3845
decorators: [

‎app/gui/chromatic.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://www.chromatic.com/config-file.schema.json",
33
"projectId": "Enso Dashboard",
4-
"autoAcceptChanges": "main",
4+
"autoAcceptChanges": "develop",
55
"exitOnceUploaded": true,
66
"skip": "dependabot/**",
77
"buildScriptName": "build-storybook:react"

‎app/gui/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"build": "vite build",
2222
"build-cloud": "cross-env CLOUD_BUILD=true corepack pnpm run build",
2323
"preview": "vite preview",
24-
"lint": "eslint . --max-warnings=0",
24+
"lint": "eslint . --cache --max-warnings=0",
2525
"format": "prettier --version && prettier --write src/ && eslint . --fix",
2626
"dev:vite": "vite",
2727
"test": "corepack pnpm run /^^^^test:.*/",
@@ -31,6 +31,8 @@
3131
"test-dev-dashboard:e2e": "cross-env NODE_ENV=production playwright test ./e2e/dashboard/ --ui",
3232
"preinstall": "corepack pnpm run generate-metadata",
3333
"generate-metadata": "node scripts/generateIconMetadata.js",
34+
"storybook:react": "cross-env FRAMEWORK=react storybook dev",
35+
"storybook:vue": "cross-env FRAMEWORK=vue storybook dev",
3436
"build-storybook:react": "cross-env FRAMEWORK=react storybook build",
3537
"build-storybook:vue": "cross-env FRAMEWORK=vue storybook build",
3638
"chromatic:react": "cross-env FRAMEWORK=react chromatic deploy",

‎app/gui/src/dashboard/styles.css

-7
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,3 @@
2323
:where(.enso-dashboard) {
2424
@apply absolute inset-0 flex flex-col overflow-hidden;
2525
}
26-
27-
/* Disable all animations. */
28-
html.disable-animations * {
29-
transition: none !important;
30-
animation: none !important;
31-
animation-play-state: paused !important;
32-
}

‎app/gui/src/dashboard/tailwind.css

+7
Original file line numberDiff line numberDiff line change
@@ -556,3 +556,10 @@ body[data-debug] {
556556
:root::highlight(field-existing-email) {
557557
@apply text-amber-500;
558558
}
559+
560+
/* Disable all animations. */
561+
html.disable-animations * {
562+
transition: none !important;
563+
animation: none !important;
564+
animation-play-state: paused !important;
565+
}

0 commit comments

Comments
 (0)
Please sign in to comment.