mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 17:17:28 +02:00
chore: simplify CI setup (#4447)
* improve ci * improve ci * use actions/setup-node@v2 everywhere * run pwd for test * debug gh action * debug glob CI issue? * Separate v1/v2 tests due to shell conflict * cleanup * test v1 change * circleci fix * fix test docusaurus v1 paths * Refactor CI script names and use paths to filter actions from running unnecessary * fix lighthouse url * v1 tests runInBand * try to fix v1 tests race conditions * change rootDir for v1 tests * minor CI improvements
This commit is contained in:
parent
1135d19333
commit
3422f80a9a
26 changed files with 243 additions and 187 deletions
|
@ -17,8 +17,9 @@ const CWD = process.cwd();
|
|||
|
||||
const loadConfig = require('../server/config');
|
||||
|
||||
const siteConfig = loadConfig(`${CWD}/website-1.x/siteConfig.js`);
|
||||
const buildDir = `${CWD}/website-1.x/build`;
|
||||
const website1Dir = 'website-1.x';
|
||||
const siteConfig = loadConfig(`${CWD}/${website1Dir}/siteConfig.js`);
|
||||
const buildDir = `${CWD}/${website1Dir}/build`;
|
||||
const docsDir = `${CWD}/docs`;
|
||||
|
||||
let inputMarkdownFiles = [];
|
||||
|
@ -26,22 +27,16 @@ let inputAssetsFiles = [];
|
|||
let outputHTMLFiles = [];
|
||||
let outputAssetsFiles = [];
|
||||
|
||||
function generateSite() {
|
||||
shell.cd('website-1.x');
|
||||
shell.exec('yarn build', {silent: true});
|
||||
}
|
||||
|
||||
function clearBuildFolder() {
|
||||
return rimraf(buildDir);
|
||||
}
|
||||
|
||||
describe('Build files', () => {
|
||||
beforeEach(() => {
|
||||
shell.cd(CWD);
|
||||
});
|
||||
|
||||
beforeAll(() => {
|
||||
generateSite();
|
||||
shell.exec(`yarn workspace docusaurus-1-website build`, {
|
||||
// silent: true
|
||||
});
|
||||
|
||||
return Promise.all([
|
||||
glob(`${docsDir}/**/*.md`),
|
||||
glob(`${buildDir}/${siteConfig.projectName}/docs/**/*.html`),
|
||||
|
@ -97,8 +92,12 @@ describe('Build files', () => {
|
|||
|
||||
describe('Build files but skip next release', () => {
|
||||
beforeAll(() => {
|
||||
shell.cd('website-1.x');
|
||||
shell.exec('yarn build --skip-next-release', {silent: true});
|
||||
shell.exec(
|
||||
`yarn workspace docusaurus-1-website build --skip-next-release`,
|
||||
{
|
||||
// silent: true,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue