Skip to content

Commit 2955913

Browse files
christian-byrnebenceruleanlu
authored andcommitted
ci: add yamllint (#6682)
adds yaml linting to CI and applies rules to existing yaml files. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6682-ci-add-yamllint-2aa6d73d365081b4b67ae9d9cc86760f) by [Unito](https://www.unito.io)
1 parent c11ed61 commit 2955913

17 files changed

+293
-237
lines changed

.github/ISSUE_TEMPLATE/bug-report.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ body:
3636
3. Click Queue Prompt
3737
4. See error
3838
value: |
39-
1.
40-
2.
41-
3.
39+
1.
40+
2.
41+
3.
4242
validations:
4343
required: true
4444

.github/workflows/api-update-manager-api-types.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ jobs:
105105
labels: Manager
106106
delete-branch: true
107107
add-paths: |
108-
src/types/generatedManagerTypes.ts
108+
src/types/generatedManagerTypes.ts

.github/workflows/ci-lint-format.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
if [ -n "$(git status --porcelain)" ]; then
5252
echo "changed=true" >> $GITHUB_OUTPUT
5353
else
54-
echo "changed=false" >> $GITHUB_OUTPUT
54+
echo "changed=false" >> $GITHUB_OUTPUT
5555
fi
5656
5757
- name: Commit changes

.github/workflows/ci-python-validation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
paths:
77
- 'tools/devtools/**'
88
push:
9-
branches: [ main ]
9+
branches: [main]
1010
paths:
1111
- 'tools/devtools/**'
1212

.github/workflows/ci-tests-e2e-forks.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
deploy-and-comment-forked-pr:
1414
runs-on: ubuntu-latest
1515
if: |
16-
github.repository == 'Comfy-Org/ComfyUI_frontend' &&
16+
github.repository == 'Comfy-Org/ComfyUI_frontend' &&
1717
github.event.workflow_run.event == 'pull_request' &&
1818
github.event.workflow_run.head_repository != null &&
1919
github.event.workflow_run.repository != null &&
@@ -43,14 +43,14 @@ jobs:
4343
repo: context.repo.repo,
4444
state: 'open',
4545
});
46-
46+
4747
const pr = prs.find(p => p.head.sha === context.payload.workflow_run.head_sha);
48-
48+
4949
if (!pr) {
5050
console.log('No PR found for SHA:', context.payload.workflow_run.head_sha);
5151
return null;
5252
}
53-
53+
5454
console.log(`Found PR #${pr.number} from fork: ${context.payload.workflow_run.head_repository.full_name}`);
5555
return pr.number;
5656
@@ -74,7 +74,7 @@ jobs:
7474
run-id: ${{ github.event.workflow_run.id }}
7575
pattern: playwright-report-*
7676
path: reports
77-
77+
7878
- name: Handle Test Completion
7979
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
8080
env:
@@ -85,9 +85,9 @@ jobs:
8585
# Rename merged report if exists
8686
[ -d "reports/playwright-report-chromium-merged" ] && \
8787
mv reports/playwright-report-chromium-merged reports/playwright-report-chromium
88-
88+
8989
chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
9090
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
9191
"${{ steps.pr.outputs.result }}" \
9292
"${{ github.event.workflow_run.head_branch }}" \
93-
"completed"
93+
"completed"

.github/workflows/ci-tests-e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
include_build_step: true
3131
- name: Setup Playwright
32-
uses: ./.github/actions/setup-playwright # Setup Playwright and cache browsers
32+
uses: ./.github/actions/setup-playwright # Setup Playwright and cache browsers
3333

3434
# Save the entire workspace as cache for later test jobs to restore
3535
- name: Generate cache key

.github/workflows/ci-tests-storybook-forks.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
deploy-and-comment-forked-pr:
1414
runs-on: ubuntu-latest
1515
if: |
16-
github.repository == 'Comfy-Org/ComfyUI_frontend' &&
16+
github.repository == 'Comfy-Org/ComfyUI_frontend' &&
1717
github.event.workflow_run.event == 'pull_request' &&
1818
github.event.workflow_run.head_repository != null &&
1919
github.event.workflow_run.repository != null &&
@@ -43,14 +43,14 @@ jobs:
4343
repo: context.repo.repo,
4444
state: 'open',
4545
});
46-
46+
4747
const pr = prs.find(p => p.head.sha === context.payload.workflow_run.head_sha);
48-
48+
4949
if (!pr) {
5050
console.log('No PR found for SHA:', context.payload.workflow_run.head_sha);
5151
return null;
5252
}
53-
53+
5454
console.log(`Found PR #${pr.number} from fork: ${context.payload.workflow_run.head_repository.full_name}`);
5555
return pr.number;
5656
@@ -74,7 +74,7 @@ jobs:
7474
run-id: ${{ github.event.workflow_run.id }}
7575
name: storybook-static
7676
path: storybook-static
77-
77+
7878
- name: Handle Storybook Completion
7979
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
8080
env:
@@ -88,4 +88,4 @@ jobs:
8888
./scripts/cicd/pr-storybook-deploy-and-comment.sh \
8989
"${{ steps.pr.outputs.result }}" \
9090
"${{ github.event.workflow_run.head_branch }}" \
91-
"completed"
91+
"completed"

.github/workflows/ci-tests-storybook.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "CI: Tests Storybook"
22
description: "Builds Storybook and runs visual regression testing via Chromatic, deploys previews to Cloudflare Pages"
33

44
on:
5-
workflow_dispatch: # Allow manual triggering
5+
workflow_dispatch: # Allow manual triggering
66
pull_request:
77
branches: [main]
88

@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v5
19-
19+
2020
- name: Post starting comment
2121
env:
2222
GITHUB_TOKEN: ${{ github.token }}
@@ -89,7 +89,7 @@ jobs:
8989
- name: Checkout code
9090
uses: actions/checkout@v5
9191
with:
92-
fetch-depth: 0 # Required for Chromatic baseline
92+
fetch-depth: 0 # Required for Chromatic baseline
9393

9494
- name: Install pnpm
9595
uses: pnpm/action-setup@v4
@@ -111,9 +111,9 @@ jobs:
111111
with:
112112
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
113113
buildScriptName: build-storybook
114-
autoAcceptChanges: 'main' # Auto-accept changes on main branch
115-
exitOnceUploaded: true # Don't wait for UI tests to complete
116-
onlyChanged: true # Only capture changed stories
114+
autoAcceptChanges: 'main' # Auto-accept changes on main branch
115+
exitOnceUploaded: true # Don't wait for UI tests to complete
116+
onlyChanged: true # Only capture changed stories
117117

118118
- name: Set job status
119119
id: job-status
@@ -138,17 +138,17 @@ jobs:
138138
steps:
139139
- name: Checkout repository
140140
uses: actions/checkout@v5
141-
141+
142142
- name: Download Storybook build
143143
if: needs.storybook-build.outputs.conclusion == 'success'
144144
uses: actions/download-artifact@v4
145145
with:
146146
name: storybook-static
147147
path: storybook-static
148-
148+
149149
- name: Make deployment script executable
150150
run: chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh
151-
151+
152152
- name: Deploy Storybook and comment on PR
153153
env:
154154
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@@ -176,25 +176,25 @@ jobs:
176176
script: |
177177
const buildUrl = '${{ needs.chromatic-deployment.outputs.chromatic-build-url }}';
178178
const storybookUrl = '${{ needs.chromatic-deployment.outputs.chromatic-storybook-url }}';
179-
179+
180180
// Find the existing Storybook comment
181181
const { data: comments } = await github.rest.issues.listComments({
182182
owner: context.repo.owner,
183183
repo: context.repo.repo,
184184
issue_number: ${{ github.event.pull_request.number }}
185185
});
186-
187-
const storybookComment = comments.find(comment =>
186+
187+
const storybookComment = comments.find(comment =>
188188
comment.body.includes('<!-- STORYBOOK_BUILD_STATUS -->')
189189
);
190-
190+
191191
if (storybookComment && buildUrl && storybookUrl) {
192192
// Append Chromatic info to existing comment
193193
const updatedBody = storybookComment.body.replace(
194194
/---\n(.*)$/s,
195195
`---\n### 🎨 Chromatic Visual Tests\n- 📊 [View Chromatic Build](${buildUrl})\n- 📚 [View Chromatic Storybook](${storybookUrl})\n\n$1`
196196
);
197-
197+
198198
await github.rest.issues.updateComment({
199199
owner: context.repo.owner,
200200
repo: context.repo.repo,
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "CI: YAML Validation"
2+
description: "Validates YAML syntax and style using yamllint with relaxed rules"
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- '**/*.yml'
10+
- '**/*.yaml'
11+
pull_request:
12+
paths:
13+
- '**/*.yml'
14+
- '**/*.yaml'
15+
16+
jobs:
17+
yaml-lint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v5
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.x'
26+
27+
- name: Install yamllint
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install yamllint
31+
32+
- name: Validate YAML syntax and style
33+
run: ./scripts/cicd/check-yaml.sh

.github/workflows/i18n-update-core.yaml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: "i18n: Update Core"
22
description: "Generates and updates translations for core ComfyUI components using OpenAI"
33

44
on:
5-
# Manual dispatch for urgent translation updates
5+
# Manual dispatch for urgent translation updates
66
workflow_dispatch:
77
# Only trigger on PRs to main/master - additional branch filtering in job condition
88
pull_request:
9-
branches: [ main ]
9+
branches: [main]
1010
types: [opened, synchronize, reopened]
1111

1212
jobs:
@@ -15,45 +15,45 @@ jobs:
1515
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))
1616
runs-on: ubuntu-latest
1717
steps:
18-
- name: Checkout repository
19-
uses: actions/checkout@v5
18+
- name: Checkout repository
19+
uses: actions/checkout@v5
2020

21-
# Setup playwright environment
22-
- name: Setup ComfyUI Frontend
23-
uses: ./.github/actions/setup-frontend
24-
with:
25-
include_build_step: true
26-
- name: Setup ComfyUI Server
27-
uses: ./.github/actions/setup-comfyui-server
28-
with:
29-
launch_server: true
30-
- name: Setup Playwright
31-
uses: ./.github/actions/setup-playwright
21+
# Setup playwright environment
22+
- name: Setup ComfyUI Frontend
23+
uses: ./.github/actions/setup-frontend
24+
with:
25+
include_build_step: true
26+
- name: Setup ComfyUI Server
27+
uses: ./.github/actions/setup-comfyui-server
28+
with:
29+
launch_server: true
30+
- name: Setup Playwright
31+
uses: ./.github/actions/setup-playwright
3232

33-
- name: Start dev server
34-
# Run electron dev server as it is a superset of the web dev server
35-
# We do want electron specific UIs to be translated.
36-
run: pnpm dev:electron &
33+
- name: Start dev server
34+
# Run electron dev server as it is a superset of the web dev server
35+
# We do want electron specific UIs to be translated.
36+
run: pnpm dev:electron &
3737

38-
# Update locales, collect new strings and update translations using OpenAI, then commit changes
39-
- name: Update en.json
40-
run: pnpm collect-i18n
41-
env:
42-
PLAYWRIGHT_TEST_URL: http://localhost:5173
43-
- name: Update translations
44-
run: pnpm locale
45-
env:
46-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
47-
- name: Commit updated locales
48-
run: |
49-
git config --global user.name 'github-actions'
50-
git config --global user.email 'github-actions@github.com'
51-
git fetch origin ${{ github.head_ref }}
52-
# Stash any local changes before checkout
53-
git stash -u
54-
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
55-
# Apply the stashed changes if any
56-
git stash pop || true
57-
git add src/locales/
58-
git diff --staged --quiet || git commit -m "Update locales"
59-
git push origin HEAD:${{ github.head_ref }}
38+
# Update locales, collect new strings and update translations using OpenAI, then commit changes
39+
- name: Update en.json
40+
run: pnpm collect-i18n
41+
env:
42+
PLAYWRIGHT_TEST_URL: http://localhost:5173
43+
- name: Update translations
44+
run: pnpm locale
45+
env:
46+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
47+
- name: Commit updated locales
48+
run: |
49+
git config --global user.name 'github-actions'
50+
git config --global user.email 'github-actions@github.com'
51+
git fetch origin ${{ github.head_ref }}
52+
# Stash any local changes before checkout
53+
git stash -u
54+
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
55+
# Apply the stashed changes if any
56+
git stash pop || true
57+
git add src/locales/
58+
git diff --staged --quiet || git commit -m "Update locales"
59+
git push origin HEAD:${{ github.head_ref }}

0 commit comments

Comments
 (0)