diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 549449ef..2883a034 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -54,19 +54,19 @@ jobs: - name: Benchmark run: bun run benchmark - publish: + test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 - uses: actions-rust-lang/setup-rust-toolchain@v1 - + - name: Install cargo-binstall run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash - name: Install cargo-tarpaulin run: cargo binstall cargo-tarpaulin --no-confirm --force - + - name: Cache cargo registry + target uses: actions/cache@v5 with: @@ -75,7 +75,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: cargo-publish-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + key: cargo-test-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} - uses: oven-sh/setup-bun@v2 with: @@ -86,7 +86,7 @@ jobs: uses: actions/cache@v5 with: path: ~/.bun/install/cache - key: bun-publish-${{ runner.os }}-${{ hashFiles('**/bun.lock') }} + key: bun-test-${{ runner.os }}-${{ hashFiles('**/bun.lock') }} - uses: jetli/wasm-pack-action@v0.4.0 with: @@ -96,8 +96,6 @@ jobs: with: registry-url: "https://registry.npmjs.org" node-version: 24 - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: bun install - run: bun run build - run: | @@ -117,6 +115,46 @@ jobs: run: | rm -rf .rustfmt.toml cargo fmt + + e2e: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Cache cargo registry + target + uses: actions/cache@v5 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: cargo-e2e-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: '1.3.9' + name: Install bun + + - name: Cache bun dependencies + uses: actions/cache@v5 + with: + path: ~/.bun/install/cache + key: bun-e2e-${{ runner.os }}-${{ hashFiles('**/bun.lock') }} + + - uses: jetli/wasm-pack-action@v0.4.0 + with: + version: 'latest' + - name: Install Node.js + uses: actions/setup-node@v4 + with: + registry-url: "https://registry.npmjs.org" + node-version: 24 + - run: bun install + - run: bun run build - name: Build Landing run: | bun run --filter @devup-ui/components build-storybook @@ -147,12 +185,64 @@ jobs: file_pattern: "e2e/**/*-snapshots/*.png" - name: Run E2E Tests run: bun run test:e2e + + single-css-e2e: + runs-on: ubuntu-latest + needs: + - e2e + steps: + - name: Checkout + uses: actions/checkout@v6 + + - uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Cache cargo registry + target + uses: actions/cache@v5 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: cargo-singlecss-e2e-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: '1.3.9' + name: Install bun + + - name: Cache bun dependencies + uses: actions/cache@v5 + with: + path: ~/.bun/install/cache + key: bun-singlecss-e2e-${{ runner.os }}-${{ hashFiles('**/bun.lock') }} + + - uses: jetli/wasm-pack-action@v0.4.0 + with: + version: 'latest' + - name: Install Node.js + uses: actions/setup-node@v4 + with: + registry-url: "https://registry.npmjs.org" + node-version: 24 + - run: bun install + - run: bun run build - name: Build Landing (singleCss) run: | + bun run --filter @devup-ui/components build-storybook + mv ./packages/components/storybook-static ./apps/landing/public/storybook rm -rf apps/landing/out apps/landing/.next apps/landing/df DEVUP_SINGLE_CSS=1 bun run --filter landing build - - name: Run E2E Tests (singleCss) - run: bun run test:e2e + - name: Cache Playwright Browsers + id: playwright-cache + uses: actions/cache@v5 + with: + path: ~/.cache/ms-playwright + key: playwright-publish-${{ runner.os }}-${{ hashFiles('**/bun.lock') }} + - name: Install Playwright Browsers + run: bunx playwright install chromium --with-deps + - name: Run E2E Tests (singleCss, non-visual) + run: bunx playwright test --grep-invert "screenshot|Visual Regression" - name: Upload singleCss Playwright Report uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} @@ -160,6 +250,63 @@ jobs: name: playwright-report-singlecss path: playwright-report/ retention-days: 30 + + publish: + runs-on: ubuntu-latest + needs: + - test + - e2e + - single-css-e2e + - benchmark + steps: + - name: Checkout + uses: actions/checkout@v6 + + - uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Install cargo-binstall + run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash + - name: Install cargo-tarpaulin + run: cargo binstall cargo-tarpaulin --no-confirm --force + + - name: Cache cargo registry + target + uses: actions/cache@v5 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: cargo-publish-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: '1.3.9' + name: Install bun + + - name: Cache bun dependencies + uses: actions/cache@v5 + with: + path: ~/.bun/install/cache + key: bun-publish-${{ runner.os }}-${{ hashFiles('**/bun.lock') }} + + - uses: jetli/wasm-pack-action@v0.4.0 + with: + version: 'latest' + - name: Install Node.js + uses: actions/setup-node@v4 + with: + registry-url: "https://registry.npmjs.org" + node-version: 24 + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: bun install + - run: bun run build + - name: Build Landing + run: | + bun run --filter @devup-ui/components build-storybook + mv ./packages/components/storybook-static ./apps/landing/public/storybook + bun run --filter landing build - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/apps/landing/next.config.ts b/apps/landing/next.config.ts index 71e66a52..51604256 100644 --- a/apps/landing/next.config.ts +++ b/apps/landing/next.config.ts @@ -1,6 +1,11 @@ +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' + import { DevupUI } from '@devup-ui/next-plugin' import createMDX from '@next/mdx' +const appRoot = dirname(fileURLToPath(import.meta.url)) + const withMDX = createMDX({ extension: /\.mdx?$/, }) @@ -13,6 +18,8 @@ export default withMDX( reactCompiler: true, }, { + devupFile: join(appRoot, 'devup.json'), + distDir: join(appRoot, 'df'), singleCss: process.env.DEVUP_SINGLE_CSS === '1', }, ), diff --git a/bun.lock b/bun.lock index 056196b2..3ff5620f 100644 --- a/bun.lock +++ b/bun.lock @@ -389,7 +389,7 @@ }, "bindings/devup-ui-wasm": { "name": "@devup-ui/wasm", - "version": "1.0.68", + "version": "1.0.69", }, "packages/bun-plugin": { "name": "@devup-ui/bun-plugin",