From c4785cd1d79c89a3a4470717e3faecad2a1e69fc Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Fri, 13 Sep 2024 21:31:20 -0300 Subject: [PATCH 1/6] chore: Add configuration for Playwright tests --- .envrc | 5 ++ .github/workflows/ci.yml | 40 ++++++++++ .gitignore | 8 ++ flake.lock | 61 +++++++++++++++ flake.nix | 62 +++++++++++++++ packages/request-state/e2e/basic.spec.ts | 29 +++++++ .../e2e/fixture/basic/astro.config.ts | 9 +++ .../e2e/fixture/basic/package.json | 10 +++ .../e2e/fixture/basic/src/pages/index.astro | 20 +++++ .../e2e/fixture/basic/tsconfig.json | 9 +++ packages/request-state/package.json | 4 + packages/request-state/playwright.config.ts | 78 +++++++++++++++++++ pnpm-lock.yaml | 62 +++++++++++++++ pnpm-workspace.yaml | 3 + turbo.json | 5 ++ 15 files changed, 405 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 packages/request-state/e2e/basic.spec.ts create mode 100644 packages/request-state/e2e/fixture/basic/astro.config.ts create mode 100644 packages/request-state/e2e/fixture/basic/package.json create mode 100644 packages/request-state/e2e/fixture/basic/src/pages/index.astro create mode 100644 packages/request-state/e2e/fixture/basic/tsconfig.json create mode 100644 packages/request-state/playwright.config.ts diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..1faf1bb0 --- /dev/null +++ b/.envrc @@ -0,0 +1,5 @@ +# shellcheck shell=bash +if ! has nix_direnv_version || ! nix_direnv_version 3.0.5; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.5/direnvrc" "sha256-RuwIS+QKFj/T9M2TFXScjBsLR6V3A17YVoEW/Q6AZ1w=" +fi +use flake diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b31e1392..3dc0646f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,6 +138,46 @@ jobs: - name: Test run: pnpm run test + test:e2e: + name: E2E test + runs-on: ubuntu-latest + timeout-minutes: 25 + needs: build + env: + NODE_VERSION: 22 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache turbo build setup + uses: actions/cache@v4 + with: + path: .turbo + key: ${{ runner.os }}-${{ env.NODE_VERSION }}-turbo-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ env.NODE_VERSION }}-turbo- + + - name: Setup PNPM + uses: pnpm/action-setup@v2 + + - name: Setup node@${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Install Playwright browsers + run: pnpm exec playwright install --with-deps + + - name: Build Packages + run: pnpm run build + + - name: Test + run: pnpm turbo test:e2e + duplicated-packages: name: Check for duplicated dependencies runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index ae4d3254..40f2b3d2 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ node_modules/ /turbo/cache-key.json .pnpm-store .parcel-cache +.direnv # dotenv environment variable files .env @@ -56,3 +57,10 @@ dist/ build/ .inox-tools/ *.js.map + +# Test results +test-results/ +test-results/ +playwright-report/ +blob-report/ +playwright/.cache/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..657ad2e7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1726203198, + "narHash": "sha256-2W3/zcYtZXdLtSyuC8vtAaCU7LCW727q2hxWOd+yC7U=", + "owner": "Fryuni", + "repo": "nixpkgs", + "rev": "aaaf317d6bc5936da1713e06544c2523d007b191", + "type": "github" + }, + "original": { + "owner": "Fryuni", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..caf628d8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,62 @@ +{ + description = "A collection of oxygen-free tools for astronauts."; + inputs = { + nixpkgs.url = "github:Fryuni/nixpkgs/master"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let + throwSystem = throw "Unsupported system: ${system}"; + pkgs = nixpkgs.legacyPackages.${system}; + + browsersInfo = builtins.fromJSON (builtins.readFile "${pkgs.playwright-driver}/browsers.json"); + in { + devShells.default = pkgs.mkShell { + packages = [ + pkgs.nodejs_20 + pkgs.corepack_20 + pkgs.playwright + ]; + + PLAYWRIGHT_NODEJS_PATH = "${pkgs.nodejs_20}/bin/node"; + PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = true; + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = 1; + PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}"; + + PLAYWRIGHT_CHROME_BIN = let + chromeInfo = pkgs.lib.lists.findFirst (b: b.name == "chromium") (throw "value not found") browsersInfo.browsers; + chromePath = + { + x86_64-linux = "chrome-linux/chrome"; + aarch64-linux = "chrome-linux/chrome"; + x86_64-darwin = "chrome-mac/Chromium.app/Contents/MacOS/Chromium"; + arm64-darwin = "chrome-mac/Chromium.app/Contents/MacOS/Chromium"; + } + .${system} + or throwSystem; + in "${pkgs.playwright-driver.browsers}/chromium-${chromeInfo.revision}/${chromePath}"; + + PLAYWRIGHT_FIREFOX_BIN = let + firefoxInfo = pkgs.lib.lists.findFirst (b: b.name == "firefox") (throw "value not found") browsersInfo.browsers; + firefoxPath = + { + x86_64-linux = "firefox-linux/firefox"; + aarch64-linux = "firefox-linux/firefox"; + x86_64-darwin = "firefox/Nightly.app/Contents/MacOS/firefox"; + arm64-darwin = "firefox/Nightly.app/Contents/MacOS/firefox"; + } + .${system} + or throwSystem; + in "${pkgs.playwright-driver.browsers}/firefox-${firefoxInfo.revision}/${firefoxPath}"; + }; + + formatter = pkgs.alejandra; + } + ); +} diff --git a/packages/request-state/e2e/basic.spec.ts b/packages/request-state/e2e/basic.spec.ts new file mode 100644 index 00000000..2e69aa5d --- /dev/null +++ b/packages/request-state/e2e/basic.spec.ts @@ -0,0 +1,29 @@ +import { setTimeout } from 'node:timers/promises'; +import { loadFixture, type PreviewServer } from '@inox-tools/astro-tests/astroFixture'; +import { test, expect } from '@playwright/test'; + +const fixture = await loadFixture({ + root: './fixture/basic', +}); + +let server: PreviewServer; + +test.beforeAll(async () => { + await fixture.build({}); + server = await fixture.preview({}); +}); + +test.afterAll(async () => { + await server?.stop(); + await server?.closed(); +}); + +test('share state ', async ({ page }) => { + const pageUrl = fixture.resolveUrl('/?name=John+Doe'); + + await page.goto(pageUrl); + + await setTimeout(15000); + + await expect(page.locator('span#name')).toHaveText('John Doe'); +}); diff --git a/packages/request-state/e2e/fixture/basic/astro.config.ts b/packages/request-state/e2e/fixture/basic/astro.config.ts new file mode 100644 index 00000000..8be37952 --- /dev/null +++ b/packages/request-state/e2e/fixture/basic/astro.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from 'astro/config'; +import node from '@astrojs/node'; +import requestState from '@inox-tools/request-state'; + +export default defineConfig({ + output: 'server', + adapter: node({ mode: 'standalone' }), + integrations: [requestState()], +}); diff --git a/packages/request-state/e2e/fixture/basic/package.json b/packages/request-state/e2e/fixture/basic/package.json new file mode 100644 index 00000000..a3e9f541 --- /dev/null +++ b/packages/request-state/e2e/fixture/basic/package.json @@ -0,0 +1,10 @@ +{ + "name": "@request-state/basic", + "private": true, + "type": "module", + "dependencies": { + "@astrojs/node": "catalog:", + "@inox-tools/request-state": "workspace:", + "astro": "catalog:" + } +} diff --git a/packages/request-state/e2e/fixture/basic/src/pages/index.astro b/packages/request-state/e2e/fixture/basic/src/pages/index.astro new file mode 100644 index 00000000..a72b0c37 --- /dev/null +++ b/packages/request-state/e2e/fixture/basic/src/pages/index.astro @@ -0,0 +1,20 @@ +--- +import { setState } from '@it-astro:state'; + +const name = Astro.url.searchParams.get('name'); +setState('name', name ?? 'World'); +--- + + + + Basic example + + +

Hello, !

+ + + diff --git a/packages/request-state/e2e/fixture/basic/tsconfig.json b/packages/request-state/e2e/fixture/basic/tsconfig.json new file mode 100644 index 00000000..eb855570 --- /dev/null +++ b/packages/request-state/e2e/fixture/basic/tsconfig.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "lib": [ + "dom" + ] + } +} diff --git a/packages/request-state/package.json b/packages/request-state/package.json index d7521663..52c0286b 100644 --- a/packages/request-state/package.json +++ b/packages/request-state/package.json @@ -26,6 +26,8 @@ "dev": "tsup --watch", "prepublish": "pnpm run build", "test": "echo 'No tests for now :('", + "test:e2e": "playwright test", + "test:e2e:report": "playwright show-report", "test:dev": "vitest --coverage.enabled=true", "test:run": "vitest run --coverage" }, @@ -36,6 +38,8 @@ "devalue": "catalog:" }, "devDependencies": { + "@inox-tools/astro-tests": "workspace:", + "@playwright/test": "catalog:", "@types/content-type": "catalog:", "@types/node": "catalog:", "@vitest/coverage-v8": "catalog:", diff --git a/packages/request-state/playwright.config.ts b/packages/request-state/playwright.config.ts new file mode 100644 index 00000000..d23d99fd --- /dev/null +++ b/packages/request-state/playwright.config.ts @@ -0,0 +1,78 @@ +import { + defineConfig, + devices, + type Project, + type PlaywrightWorkerOptions, +} from '@playwright/test'; + +type Proj = Project<{}, PlaywrightWorkerOptions>; + +const browserOptions: Record = { + chromium: { + ...devices['Desktop Chrome'], + launchOptions: { + executablePath: process.env.PLAYWRIGHT_CHROME_BIN, + }, + }, + firefox: { + ...devices['Desktop Firefox'], + launchOptions: { + executablePath: process.env.PLAYWRIGHT_FIREFOX_BIN, + }, + }, + webkit: { + ...devices['Desktop Safari'], + launchOptions: { + executablePath: process.env.PLAYWRIGHT_WEBKIT_BIN, + }, + }, +}; + +const browsers: Record = Object.fromEntries( + Object.entries(browserOptions).map(([key, value]) => [ + key, + { + name: key, + use: value, + }, + ]) +); + +const projects: Proj[] = [browsers.chromium]; + +if (process.env.CI) { + projects.push(browsers.firefox, browsers.webkit); +} else { + if (process.env.PLAYWRIGHT_FIREFOX_RUN) { + projects.push(browsers.firefox); + } + + if (process.env.PLAYWRIGHT_WEBKIT_RUN) { + projects.push(browsers.webkit); + } +} + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: './e2e', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: 'html', + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + }, + + /* Configure projects for major browsers */ + projects: projects, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bcecd8a6..6b120723 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,6 +12,9 @@ catalogs: '@astrojs/internal-helpers': specifier: ^0.4.1 version: 0.4.1 + '@astrojs/node': + specifier: ^8.3.3 + version: 8.3.3 '@astrojs/sitemap': specifier: ^3.1.6 version: 3.1.6 @@ -24,6 +27,9 @@ catalogs: '@lunariajs/core': specifier: ^0.1.1 version: 0.1.1 + '@playwright/test': + specifier: ^1.47.1 + version: 1.47.1 '@types/content-type': specifier: ^1.1.8 version: 1.1.8 @@ -470,6 +476,9 @@ importers: astro: specifier: 'catalog:' version: 4.15.3(@types/node@22.5.4)(rollup@4.21.2)(typescript@5.5.4) + debug: + specifier: 'catalog:' + version: 4.3.7 fast-glob: specifier: ^3.3.2 version: 3.3.2 @@ -741,6 +750,12 @@ importers: specifier: 'catalog:' version: 5.0.0 devDependencies: + '@inox-tools/astro-tests': + specifier: 'workspace:' + version: link:../astro-tests + '@playwright/test': + specifier: 'catalog:' + version: 1.47.1 '@types/content-type': specifier: 'catalog:' version: 1.1.8 @@ -772,6 +787,18 @@ importers: specifier: 'catalog:' version: 2.0.5(@types/node@22.5.4)(@vitest/ui@2.0.5) + packages/request-state/e2e/fixture/basic: + dependencies: + '@astrojs/node': + specifier: 'catalog:' + version: 8.3.3(astro@4.15.3(@types/node@22.5.4)(rollup@4.21.2)(typescript@5.5.4)) + '@inox-tools/request-state': + specifier: 'workspace:' + version: link:../../.. + astro: + specifier: 'catalog:' + version: 4.15.3(@types/node@22.5.4)(rollup@4.21.2)(typescript@5.5.4) + packages/runtime-logger: dependencies: '@inox-tools/modular-station': @@ -1753,6 +1780,11 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} + '@playwright/test@1.47.1': + resolution: {integrity: sha512-dbWpcNQZ5nj16m+A5UNScYx7HX5trIy7g4phrcitn+Nk83S32EBX/CLU4hiF4RGKX/yRc93AAqtfaXB7JWBd4Q==} + engines: {node: '>=18'} + hasBin: true + '@polka/url@1.0.0-next.25': resolution: {integrity: sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==} @@ -2856,6 +2888,11 @@ packages: fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -3966,6 +4003,16 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} + playwright-core@1.47.1: + resolution: {integrity: sha512-i1iyJdLftqtt51mEk6AhYFaAJCDx0xQ/O5NU8EKaWFgMjItPVma542Nh/Aq8aLCjIJSzjaiEQGW/nyqLkGF1OQ==} + engines: {node: '>=18'} + hasBin: true + + playwright@1.47.1: + resolution: {integrity: sha512-SUEKi6947IqYbKxRiqnbUobVZY4bF1uu+ZnZNJX9DfU1tlf2UhWfvVjLf01pQx9URsOr18bFVUKXmanYWhbfkw==} + engines: {node: '>=18'} + hasBin: true + postcss-load-config@6.0.1: resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} engines: {node: '>= 18'} @@ -6068,6 +6115,10 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true + '@playwright/test@1.47.1': + dependencies: + playwright: 1.47.1 + '@polka/url@1.0.0-next.25': {} '@preact/preset-vite@2.8.2(@babel/core@7.25.2)(preact@10.23.2)(vite@5.4.3(@types/node@22.5.4))': @@ -7338,6 +7389,9 @@ snapshots: fs.realpath@1.0.0: {} + fsevents@2.3.2: + optional: true + fsevents@2.3.3: optional: true @@ -8866,6 +8920,14 @@ snapshots: dependencies: find-up: 4.1.0 + playwright-core@1.47.1: {} + + playwright@1.47.1: + dependencies: + playwright-core: 1.47.1 + optionalDependencies: + fsevents: 2.3.2 + postcss-load-config@6.0.1(jiti@1.21.6)(postcss@8.4.45)(yaml@2.5.1): dependencies: lilconfig: 3.1.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 7f58c2f2..b71b05cc 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,6 +3,7 @@ catalog: astro-integration-kit: ~0.16.1 '@astrojs/compiler': ^2.10.3 '@astrojs/sitemap': ^3.1.6 + '@astrojs/node': ^8.3.3 '@astrojs/starlight': ^0.26.4 '@astrojs/internal-helpers': ^0.4.1 '@types/content-type': ^1.1.8 @@ -10,6 +11,7 @@ catalog: '@types/node': ^22.5.4 '@faker-js/faker': ^9.0.0 '@lunariajs/core': ^0.1.1 + '@playwright/test': ^1.47.1 content-type: ^1.0.5 debug: ^4.3.7 devalue: ^5.0.0 @@ -40,3 +42,4 @@ packages: - packages/* - examples/* - packages/*/tests/fixture/* + - packages/*/e2e/fixture/* diff --git a/turbo.json b/turbo.json index 771f8621..d5824168 100644 --- a/turbo.json +++ b/turbo.json @@ -19,6 +19,11 @@ "dependsOn": ["build"], "cache": false, "outputLogs": "new-only" + }, + "test:e2e": { + "dependsOn": ["build"], + "cache": false, + "outputLogs": "new-only" } } } From 4eb0bd2adb6450f6891480f2a1c60b05ab0f7ee4 Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Fri, 13 Sep 2024 21:37:57 -0300 Subject: [PATCH 2/6] Fix lockfile --- pnpm-lock.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6b120723..fc943ccd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -476,9 +476,6 @@ importers: astro: specifier: 'catalog:' version: 4.15.3(@types/node@22.5.4)(rollup@4.21.2)(typescript@5.5.4) - debug: - specifier: 'catalog:' - version: 4.3.7 fast-glob: specifier: ^3.3.2 version: 3.3.2 From fa6af5a1d9a89bcf13c23397f45f2c6e73edea30 Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Fri, 13 Sep 2024 21:42:16 -0300 Subject: [PATCH 3/6] Fix CI workflow ID --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dc0646f..3f640c42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,7 +138,7 @@ jobs: - name: Test run: pnpm run test - test:e2e: + test-e2e: name: E2E test runs-on: ubuntu-latest timeout-minutes: 25 From d7eb9b9f9c1a193b3432e82b97895e8873b5f34e Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Fri, 13 Sep 2024 21:48:23 -0300 Subject: [PATCH 4/6] wip ci --- .github/workflows/ci.yml | 2 +- docs/turbo.json | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f640c42..f0d43eba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,7 +170,7 @@ jobs: run: pnpm install - name: Install Playwright browsers - run: pnpm exec playwright install --with-deps + run: pnpm dlx playwright@latest install --with-deps - name: Build Packages run: pnpm run build diff --git a/docs/turbo.json b/docs/turbo.json index 65df999a..f468ebef 100644 --- a/docs/turbo.json +++ b/docs/turbo.json @@ -1,9 +1,20 @@ { "$schema": "https://turbo.build/schema.json", - "extends": ["//"], + "extends": [ + "//" + ], "tasks": { "build": { - "inputs": ["*", "src/**", "public/**", "../packages/*/package.json"] + "inputs": [ + "*", + "src/**", + "public/**", + "../packages/*/package.json" + ], + "outputs": [ + ".vercel", + ".astro" + ] } } } From 3367c5e9f09f74277a4b745675ada03ec58b2baf Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Fri, 13 Sep 2024 21:52:16 -0300 Subject: [PATCH 5/6] wip ci --- .github/workflows/ci.yml | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0d43eba..8a6aaf95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -176,7 +176,7 @@ jobs: run: pnpm run build - name: Test - run: pnpm turbo test:e2e + run: pnpm test:e2e duplicated-packages: name: Check for duplicated dependencies diff --git a/package.json b/package.json index 7192bf76..a1aa105c 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "postinstall": "node ./turbo/cache-key.mjs", "release": "pnpm run build && changeset publish", "test": "turbo run --concurrency=1 --filter '@inox-tools/*' test", + "test:e2e": "turbo run --concurrency=1 --filter '@inox-tools/*' test:e2e", "version": "changeset version && pnpm install && pnpm format" }, "lint-staged": { From a00efe11593270c816ccf7458f7ea519a860ebdd Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Fri, 13 Sep 2024 21:55:19 -0300 Subject: [PATCH 6/6] Remove double build --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a6aaf95..0f22b196 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,9 +172,6 @@ jobs: - name: Install Playwright browsers run: pnpm dlx playwright@latest install --with-deps - - name: Build Packages - run: pnpm run build - - name: Test run: pnpm test:e2e