Skip to content

Commit ebb35eb

Browse files
committed
ci: workflow yarn install to skip build steps of deps
1 parent 3fc768a commit ebb35eb

File tree

6 files changed

+47
-6
lines changed

6 files changed

+47
-6
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ scripts
1919
bin
2020
build.js
2121
gest
22+
print-err-logs.cjs

.github/workflows/test.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
node-version: 18
2121
- name: Install dependencies
22-
run: ./.yarn/yarn.cjs install --immutable
22+
run: ./.yarn/yarn.cjs install --immutable --mode=skip-build
2323
- name: Building Gest Runner
2424
run: ./.yarn/yarn.cjs build:gest
2525
- name: Run tests
@@ -29,3 +29,5 @@ jobs:
2929
# - ESLint lint
3030
# - TypeScript type check
3131
run: ./.yarn/yarn.cjs git-hook-tasks pre-push
32+
- name: Print Error Logs
33+
run: "node print-err-logs.cjs"

.yarnrc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
nodeLinker: node-modules
22

33
yarnPath: .yarn/releases/yarn-3.4.1.cjs
4+
5+
enableMessageNames: false

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
},
5757
"dependencies": {
5858
"buffer": "^6.0.3",
59-
"clify.js": "ncpa0cpl/clify.js#0.0.1",
59+
"clify.js": "ncpa0cpl/clify.js#0.0.2",
6060
"dilswer": "1.5.0",
6161
"esbuild": "^0.17.5",
6262
"rimraf": "^4.1.2",

print-err-logs.cjs

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const fs = require("fs");
2+
const path = require("path");
3+
4+
const leftPad = (str, length, char = " ") => {
5+
char = char[0] ?? " ";
6+
const pad = char.repeat(length);
7+
const lines = str.split("\n");
8+
return lines.map((line) => `${pad}${line}`).join("\n");
9+
};
10+
11+
const logDirs = fs
12+
.readdirSync("/tmp")
13+
.filter((dirname) => dirname.startsWith("xfs-"));
14+
15+
let errLogFound = false;
16+
17+
for (const logDir of logDirs) {
18+
const dirPath = path.resolve("/tmp", logDir);
19+
const logfiles = fs.readdirSync(dirPath);
20+
for (const logfileName of logfiles) {
21+
try {
22+
errLogFound = true;
23+
const filepath = path.resolve(dirPath, logfileName);
24+
const logfile = fs.readFileSync(filepath, "utf8");
25+
console.log("=".repeat(80));
26+
console.log("LOG:" + filepath + ":");
27+
console.log(leftPad(logfile, 2));
28+
} catch (e) {}
29+
}
30+
}
31+
32+
if (!errLogFound) {
33+
console.log("No error logs found");
34+
} else {
35+
process.exit(1);
36+
}

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -778,12 +778,12 @@ clify.js@ncpa0cpl/clify.js:
778778
languageName: node
779779
linkType: hard
780780

781-
"clify.js@ncpa0cpl/clify.js#0.0.1":
781+
"clify.js@ncpa0cpl/clify.js#0.0.2":
782782
version: 1.0.3
783-
resolution: "clify.js@https://github.com/ncpa0cpl/clify.js.git#commit=2da0d643c79bf75ae1ba7de4bc469ca2d25f88f0"
783+
resolution: "clify.js@https://github.com/ncpa0cpl/clify.js.git#commit=765946e4eda4f1b8dc7e07945890286db6ed226d"
784784
dependencies:
785785
chalk: ^4.1.2
786-
checksum: 24439d7328d7782a2dce275efe18edfd7150a233f09ffb9434507f036932c76e284b6e63f822f4c99a9860b4f7f72c5aff0f84c21d457b2900b1f8fe795c7ad4
786+
checksum: 3ccc6b441b0d1440d6dff4ac68afeb4c02736008e9871ffc3dee796671071b1cd94b861de492425497ccdf9e2a0c574b4c88a5fae233b5af0b4ff541d1ebfe86
787787
languageName: node
788788
linkType: hard
789789

@@ -2538,7 +2538,7 @@ git-hook-tasks@ncpa0cpl/git-hook-tasks:
25382538
"@typescript-eslint/eslint-plugin": latest
25392539
"@typescript-eslint/parser": latest
25402540
buffer: ^6.0.3
2541-
clify.js: "ncpa0cpl/clify.js#0.0.1"
2541+
clify.js: "ncpa0cpl/clify.js#0.0.2"
25422542
dilswer: 1.5.0
25432543
esbuild: ^0.17.5
25442544
eslint: latest

0 commit comments

Comments
 (0)