Skip to content

Commit b7cf613

Browse files
authored
improve CI (#924)
* improve CI * cleanup * fix
1 parent 85938bc commit b7cf613

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

.github/bin/list-workspaces/list-workspaces.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function listWorkspaces() {
3434

3535
for (const packageJSONPath of Array.from(packages)) {
3636
const packageJSON = JSON.parse(await fsp.readFile(packageJSONPath));
37-
const packagePath = packageJSONPath.slice(0, -1 * '/package.json'.length);
37+
const packagePath = path.relative(process.cwd(), path.dirname(packageJSONPath));
3838

3939
result.push({
4040
path: packagePath,

.github/bin/modified-workspaces/modified-workspaces.mjs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { listModifiedFilesInPullRequest } from './list-modified-files.mjs';
22
import { listWorkspaces } from '../list-workspaces/list-workspaces.mjs';
33

4-
const privateRootDependencies = [
5-
'packages/postcss-tape',
4+
const internalDependencies = [
5+
'.github/',
6+
'package-lock.json',
7+
'package.json',
8+
'rollup/',
9+
'tsconfig.json',
610
];
711

812
export async function listModifiedWorkspaces() {
@@ -40,8 +44,9 @@ export async function listModifiedWorkspaces() {
4044
const modifiedWorkspaces = new Set();
4145

4246
for (const modifiedFile of modifiedFiles) {
43-
for (const privateRootDependency of privateRootDependencies) {
44-
if (modifiedFile.startsWith(privateRootDependency)) {
47+
for (const internalDependency of internalDependencies) {
48+
if (modifiedFile.startsWith(internalDependency)) {
49+
console.error('modified a private dependency', modifiedFile);
4550
// this file can influence anything
4651
// anything or everything might have changed
4752
return {
@@ -54,6 +59,16 @@ export async function listModifiedWorkspaces() {
5459

5560
let isNonWorkspaceFile = true;
5661
for (const workspace of workspaces) {
62+
if (modifiedFile.startsWith('e2e/')) {
63+
continue;
64+
}
65+
66+
if (modifiedFile.startsWith('sites/')) {
67+
continue;
68+
}
69+
70+
console.error('modifiedFile outside of workspaces', modifiedFile);
71+
5772
if (modifiedFile.startsWith(workspace.path)) {
5873
isNonWorkspaceFile = false;
5974

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
if: matrix.is_base_node_version && matrix.is_base_os_version
7676

7777
- name: docs
78-
run: npm run docs --if-present $MODIFIED_WORKSPACES
78+
run: npm run docs
7979
if: matrix.is_base_node_version && matrix.is_base_os_version
8080

8181
- name: repo is clean after "build", "lint" and "docs" steps

0 commit comments

Comments
 (0)