-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.56 KB
/
linkcheck.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Check markdown links
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *' # Every month
push:
branches:
- main
paths:
- 'docs/**'
- '.lycheeignore'
- '.github/workflows/linkcheck.yml'
env:
DIR: 'docs'
jobs:
linkcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Julia
uses: julia-actions/setup-julia@v2
- name: Convert literate notebooks to ipynb files
shell: julia --color=yes {0}
run: |
import Pkg
Pkg.add("Literate")
using Literate
for (root, dirs, files) in walkdir("docs")
for file in files
if endswith(file, ".jl")
nb = joinpath(root, file)
Literate.notebook(nb, dirname(nb); mdstrings=true, execute=false)
end
end
end
- name: Setup Python
uses: actions/setup-python@v5
id: cp
with:
python-version: '3.x'
- name: Cache pip dependencies
uses: actions/cache@v4
id: cache-py
with:
key: ${{ runner.os }}-pip-${{ steps.cp.outputs.python-version }}-${{ hashFiles('requirements-jb.txt') }}
path: |
${{ env.pythonLocation }}/lib
${{ env.pythonLocation }}/bin
- name: Install pip dependencies if cache miss
if: ${{ steps.cache-py.outputs.cache-hit != 'true' }}
run: pip install -r requirements-jb.txt
- name: Check links
run: jb build ${DIR} --builder linkcheck