Skip to content

Commit

Permalink
chore: add e2e tests (#729)
Browse files Browse the repository at this point in the history
<!---
☝️ PR title should follow conventional commits
(https://conventionalcommits.org)
-->

### 🔗 Linked issue

<!-- If it resolves an open issue, please link the issue here. For
example "Resolves #123" -->

### ❓ Type of change

<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply. -->

- [ ] 📖 Documentation (updates to the documentation or readme)
- [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
- [ ] 👌 Enhancement (improving an existing functionality)
- [ ] ✨ New feature (a non-breaking change that adds functionality)
- [ ] 🧹 Chore (updates to the build process or auxiliary tools and
libraries)
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to change)

### 📚 Description

Add tests verifying that installing storybook in a nuxt starter app is
working fine.

<!-- Describe your changes in detail -->
<!-- Why is this change required? What problem does it solve? -->
  • Loading branch information
tobiasdiez authored Jul 20, 2024
1 parent b62c07e commit 354f9d4
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: CI

on:
push:
Expand All @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main

jobs:
ci:
runs-on: ${{ matrix.os }}
Expand All @@ -17,7 +18,8 @@ jobs:
node: [18, 20]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: E2E tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
e2e-tests:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }}
cancel-in-progress: true
name: 'Starter'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Keep this in sync with the oldest Node.js version supported by the storybook
node: [18, 19, 20]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Build packages
run: pnpm package
env:
NODE_ENV: 'production'

- name: Create Sample Project
shell: pwsh
run: |
$packages=Get-ChildItem -Path packages -Recurse -Filter "*.tgz"
echo "$packages"
New-Item -Path ${{ runner.temp }}/example -ItemType Directory
pnpm dlx nuxt init ${{ runner.temp }}/example --packageManager pnpm
cd ${{ runner.temp }}/example
pnpm dlx storybook@0.0.0-pr-28607-sha-b9bf7d39 init
pnpm add $packages
- name: Build Storybook
run: pnpm build-storybook
working-directory: ${{ runner.temp }}/example
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"example:showcase:storybook:build": "pnpm run --filter=./examples/showcase/** build-storybook",
"example:showcase:storybook:publish": "chromatic --exit-zero-on-changes --build-script-name example:showcase:storybook:build --project-token=chpt_a53adf402cb628c",
"build": "pnpm run --recursive --filter=./packages/* --parallel build",
"package": "cd ./packages/storybook-addon && pnpm pack && cd ../nuxt-module && pnpm pack",
"lint": "pnpm lint:eslint && pnpm lint:prettier",
"lint:eslint": "eslint --max-warnings=0 --report-unused-disable-directives .",
"lint:prettier": "prettier --check .",
Expand Down
3 changes: 3 additions & 0 deletions packages/nuxt-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"files": [
"dist"
],
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare",
"build": "nuxt-module-build build",
Expand Down

0 comments on commit 354f9d4

Please sign in to comment.