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
7 changes: 5 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ jobs:
# uses: github/codeql-action/autobuild@v3

# Manual build step - only install dependencies, don't build
- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Build
run: npm run build
run: pnpm build

- name: Setup Pages
uses: actions/configure-pages@v5
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ jobs:

steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run test:lib
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm test:lib
6 changes: 4 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ jobs:
options: --user 1001
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run Playwright tests
run: npm run test:playwright
run: pnpm test:playwright
- uses: actions/upload-artifact@v7
id: artifact-upload
if: ${{ !cancelled() }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/update-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@ jobs:
with:
ref: ${{ github.ref_name }}

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v6
with:
node-version: 22
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Initialise Playwright tests
run: npm run pretest:playwright
run: pnpm pretest:playwright

- name: Update snapshots
run: npm run test:init:snapshots
run: pnpm test:init:snapshots

- name: Configure Git
run: |
Expand Down
16 changes: 13 additions & 3 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,40 @@ Further examples using combinations of the components are in `src/routes/_exampl

The actual loading of these pages happens in `src/routes/components`, `src/routes/examples` and `src/routes/examples-ssr` where the Markdown descriptions from `src/content` and code files are combined.

## Setup

The root Layer Cake project uses pnpm. Install the dependencies with

```sh
pnpm install
```

The embedded project in `src/scripts/svelte-app` remains an npm-based template and is not part of a pnpm workspace.

## Testing

### Unit Tests

Unit tests using [Mocha](https://mochajs.org/) are in `test/lib` and can be run with

```sh
npm run test:lib
pnpm test:lib
```

### End-to-End Tests

To test more complex interactions of the website and rendering of documentation and the display of components [Playwright](https://playwright.dev/) is used.

```sh
npm run test:playwright
pnpm test:playwright
```

There are YAML-based ARIA snapshots of component property tables as well as screenshots of rendered components on the various pages.

They can be updated with

```sh
npm run test:init:snapshots
pnpm test:init:snapshots
```

To have better matching between the CI environment and the saved screenshots they can be updated through a CI action (in `.github/workflows/update-snapshots.yml`), for example after a component's defaults have changed.
Expand Down
Loading
Loading