52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
name: Build
|
|
on: [push, pull_request]
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
name: Build application
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
- name: Get NPM cache directory
|
|
id: npm-cache-dir
|
|
shell: bash
|
|
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
|
|
- uses: actions/cache@v4
|
|
name: Cache NPM
|
|
id: npm-cache
|
|
with:
|
|
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
- run: npm ci
|
|
name: Install dependencies
|
|
- run: npm run lint
|
|
name: Lint code
|
|
- run: npm run build
|
|
name: Build project
|
|
- name: Install Playwright browsers
|
|
run: npx playwright install --with-deps
|
|
- run: npm test
|
|
name: Test project
|
|
- uses: actions/upload-artifact@v4
|
|
name: Upload Playwright report
|
|
if: ${{ !cancelled() }}
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report/
|
|
retention-days: 30
|
|
- run: npm run build-storybook
|
|
name: Build storybook
|
|
- uses: actions/upload-artifact@v4
|
|
name: Upload build directories
|
|
with:
|
|
name: build-artifacts
|
|
path: |
|
|
dist/
|
|
build/
|
|
.svelte-kit/
|
|
storybook-static/
|