Run all smoke tests with the static build (#2609)
* Run all smoke tests with the static build * Use a direct relative path * Always use the static build * Use a path that works in both static and regualr build * Always download the zip * astro.build only needs to run once
This commit is contained in:
parent
a81660e39a
commit
2ad88a9235
2 changed files with 34 additions and 28 deletions
|
@ -11,6 +11,6 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Welcome to <a href="https://astro.build/">Astro</a></h1>
|
<h1>Welcome to <a href="https://astro.build/">Astro</a></h1>
|
||||||
<script src={Astro.resolve('../index.ts')} type="module" hoist></script>
|
<script src="/src/index.ts" type="module" hoist></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -58,6 +58,20 @@ async function run() {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Run with the static build too
|
||||||
|
if(directory.pathname.includes('astro.build')) {
|
||||||
|
// astro.build uses the static build, so rerunning with the flag actually negates it.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await execa('yarn', ['build', '--', '--experimental-static-build'], { cwd: fileURLToPath(directory), stdout: 'inherit', stderr: 'inherit' });
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,13 +93,6 @@ const downloadGithubZip = async (/** @type {GithubOpts} */ opts) => {
|
||||||
/** Expected directory when the zip is downloaded. */
|
/** Expected directory when the zip is downloaded. */
|
||||||
const githubDir = new URL(`${opts.name}-${opts.branch}`, scriptDir);
|
const githubDir = new URL(`${opts.name}-${opts.branch}`, scriptDir);
|
||||||
|
|
||||||
/** Whether the expected directory is already available */
|
|
||||||
const hasGithubDir = await fs.stat(githubDir).then(
|
|
||||||
(stats) => stats.isDirectory(),
|
|
||||||
() => false
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!hasGithubDir) {
|
|
||||||
console.log('🤖', 'Downloading', `${opts.org}/${opts.name}#${opts.branch}`);
|
console.log('🤖', 'Downloading', `${opts.org}/${opts.name}#${opts.branch}`);
|
||||||
|
|
||||||
const buffer = await fetchGithubZip(opts);
|
const buffer = await fetchGithubZip(opts);
|
||||||
|
@ -113,7 +120,6 @@ const downloadGithubZip = async (/** @type {GithubOpts} */ opts) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
await writeDirectoryPackage(githubDir, githubPackage);
|
await writeDirectoryPackage(githubDir, githubPackage);
|
||||||
}
|
|
||||||
|
|
||||||
return githubDir;
|
return githubDir;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue