Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/scripts/verify-catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ npm exec --yes --package="node@$HA_UI_NODE_VERSION" --package="$package_manager"
pnpm test:engines
pnpm test:storybook
'

test -f build/storybook/index.html
tar --dereference --hard-dereference \
--directory build/storybook --create --file /workspace/build/artifact.tar \
--exclude=.git --exclude=.github --exclude=".[^/]*" .
LINUX
8 changes: 6 additions & 2 deletions .github/workflows/storybook_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ jobs:
- name: Build and verify Storybook in Linux
shell: bash
run: bash .github/scripts/verify-catalog.sh
- uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
- name: Upload the verified Pages archive
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
path: build/storybook
name: github-pages
path: build/artifact.tar
retention-days: 1
if-no-files-found: error
deploy:
needs: build
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions docs/storybook.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ Every branch push to this repository runs `CI Check`, including strict types, fu
the static catalog build and the static browser gate. An internal pull request shows CI for its pushed head.
Bring the head up to date with the target branch before merging. Its retained artifact includes `build/storybook/`,
coverage and browser evidence. This makes a candidate reviewable before merge. The separate Pages
workflow builds and rechecks trusted `master` before upload; only its deployment job receives Pages
write and OIDC permission. It never executes PR code with deployment permissions.
workflow builds and rechecks trusted `master`, then creates the Pages archive inside the same Linux container.
Only its deployment job receives Pages write and OIDC permission.

Fork workflows require maintainer approval in GitHub.
CI and the Pages build use Apple Silicon runners in the organization's `vypdev` group.
Expand Down
6 changes: 6 additions & 0 deletions tests/architecture.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ test('Pages builds only the trusted default branch and grants write permissions
expect(verify).toContain('--platform linux/arm64');
expect(verify).toContain('--env npm_config_store_dir=/tmp/ha-ui-pnpm-store');
expect(verify).not.toContain('playwright install');
expect(verify.indexOf('tar --dereference --hard-dereference')).toBeGreaterThan(verify.indexOf('pnpm test:storybook'));
expect(verify).toContain('--directory build/storybook --create --file /workspace/build/artifact.tar');
const archive = build.steps.find(step => step.uses?.startsWith('actions/upload-artifact@'));
expect(archive.with).toEqual({
name: 'github-pages', path: 'build/artifact.tar', 'retention-days': 1, 'if-no-files-found': 'error',
});
for (const command of ['pnpm install --frozen-lockfile --ignore-scripts', 'pnpm check', 'pnpm test',
'pnpm test:package', 'pnpm test:ssr', 'pnpm storybook:build', 'pnpm test:storybook', 'pnpm test:engines']) {
expect(verify.split('\n').some(line => line.trimEnd().endsWith(' '+command))).toBe(true);
Expand Down
Loading