Skip to content

Commit

Permalink
Merge branch 'main' into mdx-plus-react-2
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored Aug 5, 2022
2 parents af29f95 + 778a4d2 commit 1d036b0
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
50 changes: 28 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env:
FORCE_COLOR: true
ASTRO_TELEMETRY_DISABLED: true


jobs:
lint:
name: Lint
Expand Down Expand Up @@ -79,8 +80,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node_version: [14]
OS: [ubuntu-latest]
NODE_VERSION: [14]
fail-fast: true
steps:
- name: Checkout
Expand All @@ -89,10 +90,10 @@ jobs:
- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup node@${{ matrix.node_version }}
- name: Setup node@${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.NODE_VERSION }}
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -102,30 +103,31 @@ jobs:
run: pnpm run build

test:
name: 'Test: ${{ matrix.os }} (node@${{ matrix.node_version }})'
name: 'Test: ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})'
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-latest]
node_version: [14, 16]
OS: [ubuntu-latest, windows-latest]
# TODO: Enable node@18!
NODE_VERSION: [14, 16]
include:
- os: windows-latest
node_version: 14
- os: macos-latest
node_version: 14
NODE_VERSION: 14
fail-fast: false
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup node@${{ matrix.node_version }}
- name: Setup node@${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.NODE_VERSION }}
cache: 'pnpm'

- name: Use Deno
Expand All @@ -143,26 +145,28 @@ jobs:
run: pnpm run test

e2e:
name: 'Test (E2E): ${{ matrix.os }} (node@${{ matrix.node_version }})'
name: 'Test (E2E): ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})'
runs-on: ${{ matrix.os }}
timeout-minutes: 20
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node_version: [14]
OS: [ubuntu-latest, windows-latest]
NODE_VERSION: [14]
fail-fast: false
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup node@${{ matrix.node_version }}
- name: Setup node@${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.NODE_VERSION }}
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -175,24 +179,26 @@ jobs:
run: pnpm run test:e2e

smoke:
name: 'Test (Smoke): ${{ matrix.os }} (node@${{ matrix.node_version }})'
name: 'Test (Smoke): ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})'
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-latest]
node_version: [14]
OS: [ubuntu-latest]
NODE_VERSION: [14]
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup node@${{ matrix.node_version }}
- name: Setup node@${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.NODE_VERSION }}
cache: 'pnpm'

- name: Checkout docs
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"format:imports": "organize-imports-cli ./packages/*/tsconfig.json ./packages/*/*/tsconfig.json",
"test": "turbo run test --output-logs=new-only --concurrency=1",
"test:match": "cd packages/astro && pnpm run test:match",
"test:templates": "turbo run test --filter=create-astro --concurrency=1",
"test:smoke": "turbo run build --filter=\"@example/*\" --filter=\"astro.build\" --filter=\"docs\" --output-logs=new-only --concurrency=1",
"test:vite-ci": "turbo run test --output-logs=new-only --no-deps --scope=astro --concurrency=1",
"test:e2e": "cd packages/astro && pnpm playwright install && pnpm run test:e2e",
Expand Down
10 changes: 3 additions & 7 deletions packages/astro/src/core/render/dev/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,9 @@ async function loadRenderer(
viteServer: ViteDevServer,
renderer: AstroRenderer
): Promise<SSRLoadedRenderer> {
// Vite modules can be out-of-date when using an un-resolved url
// We also encountered inconsistencies when using the resolveUrl and resolveId helpers
// We've found that pulling the ID directly from the urlToModuleMap is the most stable!
const id =
viteServer.moduleGraph.urlToModuleMap.get(renderer.serverEntrypoint)?.id ??
renderer.serverEntrypoint;
const mod = (await viteServer.ssrLoadModule(id)) as { default: SSRLoadedRenderer['ssr'] };
const mod = (await viteServer.ssrLoadModule(renderer.serverEntrypoint)) as {
default: SSRLoadedRenderer['ssr'];
};
return { ...renderer, ssr: mod.default };
}

Expand Down
9 changes: 5 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
"cache": false
},
"test": {
"outputs": []
},
"test:templates": {
"outputs": []
"outputs": [],
"dependsOn": [
"$RUNNER_OS",
"$NODE_VERSION"
]
},
"benchmark": {
"dependsOn": ["^build"],
Expand Down

0 comments on commit 1d036b0

Please sign in to comment.