Skip to content

Commit

Permalink
Merge pull request #2 from shopware/next-33446/pnpm
Browse files Browse the repository at this point in the history
NEXT-33446 - pnpm
  • Loading branch information
Haberkamp authored Feb 6, 2024
2 parents 25a57f5 + 0581fd1 commit 561c327
Show file tree
Hide file tree
Showing 29 changed files with 18,782 additions and 82,221 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Chromatic'

on:
push:
branches:
- main

jobs:
chromatic-deployment:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for the chromatic CLI to work

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install main dependencies
run: pnpm ci

- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
zip: true
allowConsoleErrors: true
37 changes: 37 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deployment

on:
push:
branches:
- main

jobs:
create_storybook_pages:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install main dependencies
run: pnpm ci

- name: Create the static pages directory locally in CI
run: pnpm --prefix ./packages/component-library run build-storybook

- name: Deploy 🚀
if: github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
with:
force: false
branch: gh-pages
folder: storybook-static
clean-exclude: pr-preview/
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish to NPM

on:
push:
branches:
- main

jobs:
publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: pnpm ci

- name: Build distributed files
run: pnpm --prefix ./packages/component-library run build-vue
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: 'public'
38 changes: 38 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy PR previews

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install main dependencies
run: pnpm install

- name: Create the static pages directory locally in CI
run: pnpm --prefix ./packages/component-library run build-storybook

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./packages/component-library/storybook-static/
67 changes: 67 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Tests

on:
pull_request:

push:
branches:
- main

workflow_dispatch:

jobs:
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: pnpm i

- name: Check formatting
run: pnpm run format:check

- name: Perform typecheck
run: pnpm run lint:types

- name: Lint code
run: pnpm run lint:eslint

unit-tests:
name: Unit tests
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: pnpm install

- name: unit
run: pnpm run test:unit
53 changes: 53 additions & 0 deletions .github/workflows/visual-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Visual tests

on:
push:
branches:
- main

workflow_dispatch:

jobs:
storybook-tests:
name: Storybook Tests
timeout-minutes: 60
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: pnpm install

- name: Install Playwright
run: pnpm dlx playwright install

- name: Create the static pages directory locally in CI
run: pnpm --prefix ./packages/component-library run build-storybook

- name: Run Tests
id: storybookTests
run: |
cd ./packages/component-library &&
npx concurrently --kill-others --success first --names "SB,TEST" --prefix-colors "magenta,blue" \
"http-server storybook-static -a 127.0.0.1 --port 6006" \
"wait-on http://127.0.0.1:6006 && pnpm run test-storybook"
- name: Archive visual test diffs
uses: actions/upload-artifact@v3
if: always()
with:
name: visual-test-diffs
path: ./packages/component-library/__snapshots__
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
File renamed without changes.
Loading

0 comments on commit 561c327

Please sign in to comment.