-
Notifications
You must be signed in to change notification settings - Fork 14
85 lines (72 loc) · 3.02 KB
/
submodule.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: submodule
on:
pull_request:
branches:
- main
schedule:
# Run every 6 hours Every Day
- cron: "0 0/6 * * *"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- run: bash ./scripts/check_submodules.sh
check-ipynb-to-md:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- uses: actions/setup-python@v4
with:
python-version: 3.8
- run: |
pip install pip wheel setuptools -Uqq
pip install -r ./scripts/requirements.txt -Uqq
- name: Check tutorials
run: |
bash ./scripts/nb_to_md.sh static/examples/tutorials/beginner tmp/tutorials/beginner
bash ./scripts/nb_to_md.sh static/examples/tutorials/intermediate tmp/tutorials/intermediate
bash ./scripts/nb_to_md.sh static/examples/tutorials/advanced tmp/tutorials/advanced
diff -r src/tutorials/beginner tmp/tutorials/beginner
diff -r src/tutorials/intermediate tmp/tutorials/intermediate
diff -r src/tutorials/advanced tmp/tutorials/advanced
- name: Check how-to-guides
run: |
bash ./scripts/nb_to_md.sh static/examples/how-to-guides tmp/how-to-guides
diff -r src/how-to-guides tmp/how-to-guides --exclude=_index.md
auto-pr:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- uses: actions/setup-python@v4
with:
python-version: 3.8
- run: |
pip install pip wheel setuptools -Uqq
pip install -r ./scripts/requirements.txt -Uqq
- run: git submodule update --remote -- static/examples
- run: rm -rf src/how-to-guides/[0-9][0-9]-*.md
- run: rm -rf src/tutorials/**/[0-9][0-9]-*.md
- run: bash ./scripts/nb_to_md.sh static/examples/tutorials/beginner src/tutorials/beginner
- run: bash ./scripts/nb_to_md.sh static/examples/tutorials/intermediate src/tutorials/intermediate
- run: bash ./scripts/nb_to_md.sh static/examples/tutorials/advanced src/tutorials/advanced
- run: bash ./scripts/nb_to_md.sh static/examples/how-to-guides src/how-to-guides
- uses: peter-evans/create-pull-request@v6
with:
title: '[automated] Submodule update'
body: This is an automated pull request.
commit-message: 'chore: update submodules'
branch: submodule-update