diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d02d6b2..e77669fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: ci +name: CI on: push: @@ -7,6 +7,7 @@ on: pull_request: branches: - main + jobs: ci: runs-on: ${{ matrix.os }} @@ -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 diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 00000000..0d4cdf8e --- /dev/null +++ b/.github/workflows/e2e.yml @@ -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 diff --git a/package.json b/package.json index c6ed14be..be41db87 100755 --- a/package.json +++ b/package.json @@ -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 .", diff --git a/packages/nuxt-module/package.json b/packages/nuxt-module/package.json index 14dfd2fa..5d6ba332 100644 --- a/packages/nuxt-module/package.json +++ b/packages/nuxt-module/package.json @@ -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",