diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml index 01f87c177c2..9866144f4d8 100644 --- a/.github/workflows/reusable-test.yml +++ b/.github/workflows/reusable-test.yml @@ -163,7 +163,7 @@ jobs: fail-fast: false matrix: node: ${{ fromJSON(inputs.node_version) }} - browser: ["edge"] + browser: ["msedge"] runs-on: windows-latest steps: diff --git a/.github/workflows/shared-build.yml b/.github/workflows/shared-build.yml new file mode 100644 index 00000000000..7608c8668fb --- /dev/null +++ b/.github/workflows/shared-build.yml @@ -0,0 +1,36 @@ +name: ๐ ๏ธ Build + +on: + workflow_call: + +env: + CI: true + CYPRESS_INSTALL_BINARY: 0 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: ๐ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.11.0 + + - name: โฌ๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: โ Setup node + uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" + cache: "yarn" + + - name: Disable GitHub Actions Annotations + run: | + echo "::remove-matcher owner=tsc::" + echo "::remove-matcher owner=eslint-compact::" + echo "::remove-matcher owner=eslint-stylish::" + + - name: ๐ฅ Install deps + run: yarn --frozen-lockfile + + - name: ๐ Build + run: yarn build diff --git a/.github/workflows/shared-test-integration.yml b/.github/workflows/shared-test-integration.yml new file mode 100644 index 00000000000..5fcc4cba5f7 --- /dev/null +++ b/.github/workflows/shared-test-integration.yml @@ -0,0 +1,62 @@ +name: ๐งช Test (Integration) + +on: + workflow_call: + inputs: + os: + required: true + type: string + node_version: + required: true + # this is limited to string | boolean | number (https://github.community/t/can-action-inputs-be-arrays/16457) + # but we want to pass an array (node_version: "[18, 20]"), + # so we'll need to manually stringify it for now + type: string + browser: + required: true + # this is limited to string | boolean | number (https://github.community/t/can-action-inputs-be-arrays/16457) + # but we want to pass an array (browser: "['chromium', 'firefox']"), + # so we'll need to manually stringify it for now + type: string + +env: + CI: true + CYPRESS_INSTALL_BINARY: 0 + +jobs: + integration: + name: "${{ inputs.os }} / node@${{ matrix.node }} / ${{ matrix.browser }}" + strategy: + fail-fast: false + matrix: + node: ${{ fromJSON(inputs.node_version) }} + browser: ${{ fromJSON(inputs.browser) }} + + runs-on: ${{ inputs.os }} + steps: + - name: ๐ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.11.0 + + - name: โฌ๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: โ Setup node ${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: "yarn" + + - name: Disable GitHub Actions Annotations + run: | + echo "::remove-matcher owner=tsc::" + echo "::remove-matcher owner=eslint-compact::" + echo "::remove-matcher owner=eslint-stylish::" + + - name: ๐ฅ Install deps + run: yarn --frozen-lockfile + + - name: ๐ฅ Install Playwright + run: npx playwright install --with-deps ${{ matrix.browser }} + + - name: ๐ Run Integration Tests ${{ matrix.browser }} + run: "yarn test:integration --project=${{ matrix.browser }}" diff --git a/.github/workflows/shared-test-unit.yml b/.github/workflows/shared-test-unit.yml new file mode 100644 index 00000000000..756645c0bdf --- /dev/null +++ b/.github/workflows/shared-test-unit.yml @@ -0,0 +1,55 @@ +name: ๐งช Test (Unit) + +on: + workflow_call: + inputs: + os: + required: true + type: string + node_version: + required: true + # this is limited to string | boolean | number (https://github.community/t/can-action-inputs-be-arrays/16457) + # but we want to pass an array (node_version: "[18, 20]"), + # so we'll need to manually stringify it for now + type: string + +env: + CI: true + CYPRESS_INSTALL_BINARY: 0 + +jobs: + test: + name: "${{ inputs.os }} / node@${{ matrix.node }}" + strategy: + fail-fast: false + matrix: + node: ${{ fromJSON(inputs.node_version) }} + runs-on: ${{ inputs.os }} + steps: + - name: ๐ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.11.0 + + - name: โฌ๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: โ Setup node ${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: "yarn" + + - name: Disable GitHub Actions Annotations + run: | + echo "::remove-matcher owner=tsc::" + echo "::remove-matcher owner=eslint-compact::" + echo "::remove-matcher owner=eslint-stylish::" + + - name: ๐ฅ Install deps + run: yarn --frozen-lockfile + + # It's faster to use the built `cli.js` in tests if its available and up-to-date + - name: ๐ Build + run: yarn build + + - name: ๐งช Run Primary Tests + run: "yarn test:primary" diff --git a/.github/workflows/test-full.yml b/.github/workflows/test-full.yml new file mode 100644 index 00000000000..5d9a15561d7 --- /dev/null +++ b/.github/workflows/test-full.yml @@ -0,0 +1,63 @@ +name: Branch + +# main/dev branches will get the full run across all OS/browsers + +on: + push: + branches: + - main + - dev + paths-ignore: + - "docs/**" + - "scripts/**" + - "contributors.yml" + - "**/*.md" + +jobs: + build: + name: "โ๏ธ Build" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-build.yml + + unit-ubuntu: + name: "๐งช Unit Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-unit.yml + with: + os: "ubuntu-latest" + node_version: '["latest"]' + + unit-windows: + name: "๐งช Unit Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-unit.yml + with: + os: "windows-latest" + node_version: '["latest"]' + + integration-ubuntu: + name: "๐ Integration Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-integration.yml + with: + os: "ubuntu-latest" + node_version: '["latest"]' + browser: '["chromium", "firefox"]' + + integration-windows: + name: "๐ Integration Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-integration.yml + with: + os: "windows-latest" + node_version: '["latest"]' + browser: '["msedge"]' + + integration-macos: + name: "๐ Integration Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-integration.yml + with: + os: "macos-latest" + node_version: '["latest"]' + browser: '["webkit"]' diff --git a/.github/workflows/test-pr-ubuntu.yml b/.github/workflows/test-pr-ubuntu.yml new file mode 100644 index 00000000000..e7b8a536592 --- /dev/null +++ b/.github/workflows/test-pr-ubuntu.yml @@ -0,0 +1,34 @@ +name: PR (Base) + +# All PRs touching code will run tests on ubuntu/node/chromium + +on: + pull_request: + paths-ignore: + - "docs/**" + - "scripts/**" + - "contributors.yml" + - "**/*.md" + +jobs: + build: + name: "โ๏ธ Build" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-build.yml + + unit-ubuntu: + name: "๐งช Unit Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-unit.yml + with: + os: "ubuntu-latest" + node_version: '["latest"]' + + integration-chromium: + name: "๐ Integration Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-integration.yml + with: + os: "ubuntu-latest" + node_version: '["latest"]' + browser: '["chromium"]' diff --git a/.github/workflows/test-pr-windows-macos.yml b/.github/workflows/test-pr-windows-macos.yml new file mode 100644 index 00000000000..7dc4a923a39 --- /dev/null +++ b/.github/workflows/test-pr-windows-macos.yml @@ -0,0 +1,46 @@ +name: PR (Full) + +# PRs touching create-remix/remix-dev will also run on Windows and OSX + +on: + pull_request: + paths: + - "packages/create-remix/**" + - "packages/remix-dev/**" + - "!**/*.md" + +jobs: + unit-windows: + name: "๐งช Unit Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-unit.yml + with: + os: "windows-latest" + node_version: '["latest"]' + + integration-firefox: + name: "๐ Integration Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-integration.yml + with: + os: "ubuntu-latest" + node_version: '["latest"]' + browser: '["firefox"]' + + integration-msedge: + name: "๐ Integration Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-integration.yml + with: + os: "windows-latest" + node_version: '["latest"]' + browser: '["msedge"]' + + integration-webkit: + name: "๐ Integration Test" + if: github.repository == 'remix-run/remix' + uses: ./.github/workflows/shared-test-integration.yml + with: + os: "macos-latest" + node_version: '["latest"]' + browser: '["webkit"]' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 14905fe4d14..00000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: ๐งช Test - -on: - push: - branches: - - main - - dev - paths-ignore: - - "docs/**" - - "scripts/**" - - "contributors.yml" - - "**/*.md" - pull_request: - paths-ignore: - - "docs/**" - - "scripts/**" - - "contributors.yml" - - "**/*.md" - -jobs: - test: - if: github.repository == 'remix-run/remix' - uses: ./.github/workflows/reusable-test.yml - with: - node_version: '["latest"]' diff --git a/integration/fetcher-test.ts b/integration/fetcher-test.ts index 2bca2fcbf15..321162a5c1f 100644 --- a/integration/fetcher-test.ts +++ b/integration/fetcher-test.ts @@ -244,8 +244,11 @@ test.describe("useFetcher", () => { method: "get", }), ]); - - await page.waitForSelector(`pre:has-text("${LUNCH}")`); + // Check full HTML here - Chromium/Firefox/Webkit seem to render this in + // a
but Edge puts it in some weird code editor markup: + // + //"LUNCH"+ expect(await app.getHtml()).toContain(LUNCH); }); test("Form can hit an action", async ({ page }) => { @@ -258,7 +261,11 @@ test.describe("useFetcher", () => { method: "post", }), ]); - await page.waitForSelector(`pre:has-text("${CHEESESTEAK}")`); + // Check full HTML here - Chromium/Firefox/Webkit seem to render this in + // abut Edge puts it in some weird code editor markup: + // + //"LUNCH"+ expect(await app.getHtml()).toContain(CHEESESTEAK); }); }); diff --git a/integration/hmr-test.ts b/integration/hmr-test.ts index f217123e375..e41deacc3b4 100644 --- a/integration/hmr-test.ts +++ b/integration/hmr-test.ts @@ -590,7 +590,7 @@ whatsup // let expectedErrorCount = 0; let expectDestructureTypeError = expectConsoleError((error) => { let expectedMessage = new Set([ - // chrome, edge + // chrome, msedge "Cannot destructure property 'hello' of 'useLoaderData(...)' as it is null.", // firefox "(intermediate value)() is null", diff --git a/integration/playwright.config.ts b/integration/playwright.config.ts index 8b30808720e..62c3e39cfd3 100644 --- a/integration/playwright.config.ts +++ b/integration/playwright.config.ts @@ -26,8 +26,13 @@ const config: PlaywrightTestConfig = { use: devices["Desktop Safari"], }, { - name: "edge", - use: devices["Desktop Edge"], + name: "msedge", + use: { + ...devices["Desktop Edge"], + // Desktop Edge uses chromium by default + // https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json#L1502 + channel: "msedge", + }, }, { name: "firefox",