diff --git a/.github/workflows/foundation-ci.yml b/.github/workflows/foundation-ci.yml index 1da833955..64fa26e0d 100644 --- a/.github/workflows/foundation-ci.yml +++ b/.github/workflows/foundation-ci.yml @@ -50,6 +50,10 @@ jobs: run: python -m compileall -q tests - name: Validate foundation pack run: npm run validate + - name: Install Node dependencies + run: npm ci + - name: Build Storybook + run: npm run build-storybook - name: Prove Foundation CI dependency hygiene run: bash tests/test_foundation_ci_dependency_hygiene.sh - name: Prove HRIS kernel diff --git a/.github/workflows/hr-workspace-browser-e2e.yml b/.github/workflows/hr-workspace-browser-e2e.yml new file mode 100644 index 000000000..e59a70c1c --- /dev/null +++ b/.github/workflows/hr-workspace-browser-e2e.yml @@ -0,0 +1,57 @@ +name: HR Workspace Browser E2E + +on: + pull_request: + branches: + - develop + paths: + - "apps/hr-workspace/**" + - "packages/design-tokens/**" + - "tests/e2e/**" + - "playwright.config.mjs" + - "package.json" + - "package-lock.json" + - ".github/workflows/hr-workspace-browser-e2e.yml" + - "tests/validate_repository.py" + - "scripts/foundation-contract-core.mjs" + - "manifest.json" + - "docs/STORYBOOK.md" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: hr-workspace-browser-e2e-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + browser: + name: HR workspace Chromium E2E + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout exact candidate + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + persist-credentials: false + - name: Prove exact candidate checkout + env: + ORGMETRA_EXPECTED_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + run: test "$(git rev-parse HEAD)" = "$ORGMETRA_EXPECTED_HEAD_SHA" + - name: Set up Node.js LTS + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: "24" + check-latest: false + - name: Install Node dependencies + run: npm ci + - name: Install Chromium and Linux dependencies + run: npx playwright install --with-deps chromium + - name: Run HR workspace browser E2E + run: npm run test:e2e + - name: Require clean checkout + run: | + git diff --exit-code + test -z "$(git status --porcelain)" diff --git a/.gitignore b/.gitignore index 1f0b61ba5..e5d4913eb 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ node_modules/ dist/ coverage/ .turbo/ +storybook-static/ +playwright-report/ +test-results/ # Rust /target/ @@ -35,3 +38,4 @@ secrets/ artifacts/ reports/ *.log +/.codegraph/ diff --git a/.storybook/main.js b/.storybook/main.js new file mode 100644 index 000000000..87fa64439 --- /dev/null +++ b/.storybook/main.js @@ -0,0 +1,8 @@ +/** @type { import('@storybook/web-components-vite').StorybookConfig } */ +const config = { + stories: ['../apps/hr-workspace/**/*.stories.@(js|mjs)'], + framework: '@storybook/web-components-vite', + docs: { autodocs: 'tag' } +}; + +export default config; diff --git a/.storybook/preview.js b/.storybook/preview.js new file mode 100644 index 000000000..058f02b9b --- /dev/null +++ b/.storybook/preview.js @@ -0,0 +1,13 @@ +import '../packages/design-tokens/tokens.css'; +import '../apps/hr-workspace/styles.css'; + +/** @type { import('storybook').Preview } */ +const preview = { + parameters: { + layout: 'centered', + controls: { expanded: true } + }, + decorators: [(story) => `