Skip to content

Commit 6d0760c

Browse files
authored
Check and fix broken links in docs (#1085)
This PR adds a Github workflow to check if there is any broken links in the docs. It also fixes existing broken links found by the workflow. This PR closes #1084.
1 parent 2d3677d commit 6d0760c

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

.github/workflows/link-check.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Check broken links in docs
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
check-broken-links-in-docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Restore lychee cache
14+
uses: actions/cache@v3
15+
with:
16+
path: .lycheecache
17+
key: cache-lychee-${{ github.sha }}
18+
restore-keys: cache-lychee-
19+
- name: Check links in docs/*.md
20+
uses: lycheeverse/lychee-action@v1.9.0
21+
with:
22+
fail: true
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
args: --base docs --accept '200,201,202,203,204,429,500' --no-progress --cache --max-cache-age 1d './docs/**/*.md' --exclude https://users.cecs.anu.edu.au/~steveb/pubs/papers/**
25+
- name: Save lychee cache
26+
uses: actions/cache/save@v3
27+
if: always()
28+
with:
29+
path: .lycheecache
30+
key: ${{ steps.restore-cache.outputs.cache-primary-key }}

.github/workflows/merge-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
# - this action
2121
# - minimal tests for stable Rust (we allow them to fail)
2222
# - binding tests (it may take long to run)
23-
ignoreActions: "ready-to-merge,check-public-api-changes,minimal-tests-core/x86_64-unknown-linux-gnu/stable,minimal-tests-core/i686-unknown-linux-gnu/stable,minimal-tests-core/x86_64-apple-darwin/stable,v8-binding-test,openjdk-binding-test,jikesrvm-binding-test,julia-binding-test,ruby-binding-test (release),ruby-binding-test (debug)"
23+
ignoreActions: "ready-to-merge,check-broken-links-in-docs,check-public-api-changes,minimal-tests-core/x86_64-unknown-linux-gnu/stable,minimal-tests-core/i686-unknown-linux-gnu/stable,minimal-tests-core/x86_64-apple-darwin/stable,v8-binding-test,openjdk-binding-test,jikesrvm-binding-test,julia-binding-test,ruby-binding-test (release),ruby-binding-test (debug)"
2424
# This action uses API. We have a quota of 1000 per hour.
2525
checkInterval: 600
2626
env:

docs/userguide/src/portingguide/howto/nogc.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ You want to set up the binding repository/directory structure before starting th
1313

1414
[^1]: In fact some bindings may not be able to have such a directory structure due to the build tools used by the runtime.
1515

16-
- `mmtk-X/mmtk`: The MMTk side of the binding. To start with, this can be an almost direct copy of the [Dummy VM binding](https://github.com/mmtk/mmtk-core/tree/master/vmbindings/dummyvm). This is implemented in Rust.
16+
- `mmtk-X/mmtk`: The MMTk side of the binding. This includes the implementation of [the `VMBinding` trait](https://docs.mmtk.io/api/mmtk/vm/trait.VMBinding.html),
17+
and any necessary Rust code to integrate MMTk with the VM code (e.g. exposing MMTk functions to native, allowing up-calls from the MMTk binding to the runtime, etc).
18+
To start with, you can take a look at one of our officially maintained language bindings as an example: [OpenJDK](https://github.com/mmtk/mmtk-openjdk/tree/master/mmtk),
19+
[JikesRVM](https://github.com/mmtk/mmtk-jikesrvm/tree/master/mmtk), [V8](https://github.com/mmtk/mmtk-v8/tree/master/mmtk), [Julia](https://github.com/mmtk/mmtk-julia/tree/master/mmtk),
20+
[V8](https://github.com/mmtk/mmtk-v8/tree/master/mmtk).
1721
- `mmtk-X/X`: Runtime-specific code for integrating with MMTk. This should act as a bridge between the generic GC interface offered by the runtime and the MMTk side of the binding. This is implemented in the runtime's implementation language. Often this will be one of C or C++.
1822
- You can place your runtime repository at any path. For the sake of this guide, we assume you will place the runtime repo as a sibling of the binding repo. You can also clone `mmtk-core` to a local path. Using a local repo of `mmtk-core` can be beneficial to your development in case you need to make certain changes to the core (though this is unlikely).
1923

@@ -107,7 +111,7 @@ We recommend going through the [list of constants in the documentation](https://
107111
Now that we have most of the boilerplate set up, the next step is to initialize MMTk so that we can start allocating objects.
108112

109113
### Runtime-side changes
110-
Create a `mmtk.h` header file in the runtime folder of the binding (i.e. `mmtk-X/X`) which exposes the functions required to implement NoGC and `#include` it in the relevant runtime code. You can use the [DummyVM `mmtk.h` header file](https://github.com/mmtk/mmtk-core/blob/master/vmbindings/dummyvm/api/mmtk.h) as an example.
114+
Create a `mmtk.h` header file in the runtime folder of the binding (i.e. `mmtk-X/X`) which exposes the functions required to implement NoGC and `#include` it in the relevant runtime code. You can use the [example `mmtk.h` header file](https://github.com/mmtk/mmtk-core/blob/master/docs/header/mmtk.h) as an example.
111115

112116
**Note:** It is convention to prefix all MMTk API functions exposed with `mmtk_` in order to avoid name clashes. It is *highly* recommended that you follow this convention.
113117

0 commit comments

Comments
 (0)