Skip to content

Commit 35df92d

Browse files
committed
ci: let linkcheck not always fail in CI
1 parent 2c78e14 commit 35df92d

File tree

7 files changed

+51
-40
lines changed

7 files changed

+51
-40
lines changed

docs/.vitepress/config.mts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function autoTitle(link: string) {
1010
const fullPath = path.join(
1111
url.fileURLToPath(import.meta.url),
1212
"../../",
13-
link + (path.extname(link) ? "" : ".md")
13+
link + (path.extname(link) ? "" : ".md"),
1414
);
1515

1616
const { data, content } = matter(fs.readFileSync(fullPath));
@@ -31,7 +31,7 @@ function autoTitle(link: string) {
3131

3232
const vuetifyComponents = fs
3333
.readdirSync(
34-
path.resolve(__dirname, "../stacks/vue/coalesce-vue-vuetify/components")
34+
path.resolve(__dirname, "../stacks/vue/coalesce-vue-vuetify/components"),
3535
)
3636
.map((f) => autoTitle("/stacks/vue/coalesce-vue-vuetify/components/" + f));
3737

@@ -50,7 +50,7 @@ function getComponentCategory(item: (typeof vuetifyComponents)[0]) {
5050

5151
const attributes = fs
5252
.readdirSync(
53-
path.resolve(__dirname, "../modeling/model-components/attributes")
53+
path.resolve(__dirname, "../modeling/model-components/attributes"),
5454
)
5555
.map((f) => autoTitle("/modeling/model-components/attributes/" + f));
5656

@@ -97,7 +97,7 @@ export default defineConfig({
9797
},
9898

9999
editLink: {
100-
pattern: "https://github.com/IntelliTect/Coalesce/blob/dev/docs/:path",
100+
pattern: "https://github.com/IntelliTect/Coalesce/blob/main/docs/:path",
101101
},
102102

103103
sidebar: [
@@ -171,7 +171,7 @@ export default defineConfig({
171171
collapsed: false,
172172
items: [
173173
...vuetifyComponents.filter(
174-
(i) => getComponentCategory(i) == "display"
174+
(i) => getComponentCategory(i) == "display",
175175
),
176176
],
177177
},
@@ -192,7 +192,7 @@ export default defineConfig({
192192
collapsed: true,
193193
items: [
194194
...vuetifyComponents.filter(
195-
(i) => getComponentCategory(i) == "admin"
195+
(i) => getComponentCategory(i) == "admin",
196196
),
197197
],
198198
},
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Skip file for CI environments (GitHub Actions)
2+
# In CI, we can only reliably check internal links, not external websites
3+
# This filter excludes all non-localhost external links
4+
5+
# Skip all external links (anything that's not localhost)
6+
^https?://(?!localhost)
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
github.com/intellitect/coalesce/edit
2-
3-
# fails on github actions randomly:
4-
https://www.npmjs.com/package
5-
https://github.com/IntelliTect/Coalesce
6-
https://intellitect.com
7-
https://www.intellitect.com
2+
github.com/IntelliTect/Coalesce/blob/main
3+
github.com/IntelliTect/Coalesce/blob/1fb00c7de5e363aaf3c1a78f45af3b949b11dff4/src/coalesce-vue/test/utils.spec.ts#L5

docs/check-links.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,21 @@ try {
3131
// Wait for server to be ready
3232
await waitOn({ resources: ["http://localhost:8087"], timeout: 30000 });
3333

34+
// Choose skip file based on environment
35+
const isCI =
36+
process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true";
37+
const skipFile = isCI
38+
? "./.vitepress/linkcheck-skip-file-ci.txt"
39+
: "./.vitepress/linkcheck-skip-file.txt";
40+
41+
console.log(`Running linkcheck with skip file: ${skipFile} (CI: ${isCI})`);
42+
3443
// Run linkcheck
3544
await run("linkcheck", [
3645
"localhost:8087/Coalesce",
3746
"-e",
3847
"--skip-file",
39-
"./.vitepress/linkcheck-skip-file.txt",
48+
skipFile,
4049
]);
4150

4251
process.exit(0);
-3.98 KB
Binary file not shown.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"devDependencies": {
1919
"gray-matter": "^4.0.3",
20-
"linkcheck-bin": "file:linkcheck-bin-3.0.0-1.fix-issue-56.tgz",
20+
"linkcheck-bin": "3.0.0-2",
2121
"serve-handler": "^6.1.6",
2222
"vitepress": "2.0.0-alpha.5",
2323
"wait-on": "^8.0.4"

package-lock.json

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)