Skip to content

Commit 1d14421

Browse files
authored
misc: CI workflow for PR (#34)
Signed-off-by: bowlingzhu <bowlingzhu@tencent.com>
1 parent 32c4388 commit 1d14421

File tree

5 files changed

+90
-67
lines changed

5 files changed

+90
-67
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ indent_size = 4
99
indent_style = space
1010
trim_trailing_whitespace = true
1111

12-
[*.yaml]
12+
[*.yaml, *.yml]
1313
indent_size = 2
1414

1515
[*.md]

.github/workflows/ci.yml

Lines changed: 63 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,68 @@
11
# https://squidfunk.github.io/mkdocs-material/publishing-your-site/
22
name: ci
33
on:
4-
push:
5-
branches:
6-
- master
7-
- main
8-
workflow_dispatch:
9-
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
1012
permissions:
11-
contents: write
13+
contents: write
1214
jobs:
13-
deploy:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
- name: sed mkdocs.yaml
20-
run: |
21-
sed -i 's/enabled: false/enabled: true/' mkdocs.yml
22-
- name: Configure Git Credentials
23-
run: |
24-
git config user.name github-actions[bot]
25-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
26-
- uses: actions/setup-python@v5
27-
with:
28-
python-version: 3.x
29-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
30-
- uses: actions/cache@v4
31-
with:
32-
key: mkdocs-material-${{ env.cache_id }}
33-
path: .cache
34-
restore-keys: |
35-
mkdocs-material-
36-
- run: pip install -r requirements.txt
37-
- run: mkslides build slides/ -d site-slides
38-
- run: mv site-slides/index.html docs/slides/index.md
39-
- run: mkdocs build
40-
- run: mv site-slides/* site/slides/
41-
- run: rm -rf site/slides/assets/reveal-js/.git
42-
- run: mkdocs gh-deploy --dirty --force --no-history
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: 3.x
24+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
25+
- uses: actions/cache@v4
26+
with:
27+
key: mkdocs-material-${{ env.cache_id }}
28+
path: .cache
29+
restore-keys: |
30+
mkdocs-material-
31+
- run: pip install -r requirements.txt
32+
- run: mkslides build slides/ -d site-slides
33+
- run: mv site-slides/index.html docs/slides/index.md
34+
- run: mkdocs build
35+
36+
deploy:
37+
# only deploy on main repo
38+
runs-on: ubuntu-latest
39+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'ZJUSCT/HPC101'
40+
needs: build
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
- name: enable git-committers
46+
run: |
47+
sed -i 's/enabled: false/enabled: true/' mkdocs.yml
48+
- name: Configure Git Credentials
49+
run: |
50+
git config user.name github-actions[bot]
51+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
52+
- uses: actions/setup-python@v5
53+
with:
54+
python-version: 3.x
55+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
56+
- uses: actions/cache@v4
57+
with:
58+
key: mkdocs-material-${{ env.cache_id }}
59+
path: .cache
60+
restore-keys: |
61+
mkdocs-material-
62+
- run: pip install -r requirements.txt
63+
- run: mkslides build slides/ -d site-slides
64+
- run: mv site-slides/index.html docs/slides/index.md
65+
- run: mkdocs build
66+
- run: mv site-slides/* site/slides/
67+
- run: rm -rf site/slides/assets/reveal-js/.git
68+
- run: mkdocs gh-deploy --dirty --force --no-history

docs/index.assets/lab_gantt.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
- title: HPC 101 实验安排
2+
activities:
3+
- title: Lab 1
4+
start: 2025-06-25
5+
end: 2025-07-03
6+
- title: Lab 2
7+
start: 2025-07-01
8+
end: 2025-07-22
9+
- title: Lab 2.5
10+
start: 2025-07-07
11+
end: 2025-08-25
12+
- title: Lab 3
13+
start: 2025-07-16
14+
end: 2025-08-06
15+
- title: Lab 4
16+
start: 2025-07-30
17+
end: 2025-08-13
18+
- title: Lab 5
19+
start: 2025-08-11
20+
end: 2025-08-25
21+
- title: 大作业
22+
start: 2025-07-13
23+
end: 2025-08-31

docs/index.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -111,33 +111,7 @@ HPC 101 可以用来申请替代计算机学院非计科专业的短学期课程
111111
| Lab 5 | 林熙, 茅晋源, 尤傲 | ~2025-08-11 | ~2025-08-25 |
112112
| 大作业 | 蒋翼泽, 李厚融, 杨星宇 | 2025-07-13 | 2025-08-31 |
113113

114-
::gantt:: month-format="%b"
115-
116-
- title: HPC 101 实验安排
117-
activities:
118-
- title: Lab 1
119-
start: 2025-06-25
120-
end: 2025-07-03
121-
- title: Lab 2
122-
start: 2025-07-01
123-
end: 2025-07-22
124-
- title: Lab 2.5
125-
start: 2025-07-07
126-
end: 2025-08-25
127-
- title: Lab 3
128-
start: 2025-07-16
129-
end: 2025-08-06
130-
- title: Lab 4
131-
start: 2025-07-30
132-
end: 2025-08-13
133-
- title: Lab 5
134-
start: 2025-08-11
135-
end: 2025-08-25
136-
- title: 大作业
137-
start: 2025-07-13
138-
end: 2025-08-31
139-
140-
::/gantt::
114+
[gantt month-format="%b"(docs/index.assets/lab_gantt.yaml)]
141115

142116
### FAQ
143117

docs/lab/Lab1-MiniCluster/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@ zlib 是 OpenMPI 的可选依赖,用于改善数据传输性能,可在构建
511511
- 前往在线文档,查看[构建和安装部分](https://docs.open-mpi.org/en/v5.0.x/installing-open-mpi/quickstart.html),按文档指示构建并安装 OpenMPI。
512512
- 验证安装是否成功。提示:运行 `ompi_info -all`
513513
- 构建 BLAS,CBLAS:
514-
- 下载指定版本 BLAS 源码: [blas-3.12.0.tgz](./assets/blas-3.12.0.tgz), 并完成构建。
515-
- 下载指定版本 CBLAS 源码: [CBLAS.tgz](./assets/CBLAS.tgz)。相应修改 `Makefile.in` 后完成构建。`我们希望你能解决所有报错。`
514+
- 下载指定版本 BLAS 源码: `src/lab1/blas-3.12.0.tgz`, 并完成构建。
515+
- 下载指定版本 CBLAS 源码: `src/lab1/CBLAS.tgz`。相应修改 `Makefile.in` 后完成构建。`我们希望你能解决所有报错。`
516516
- 如果没有错误,两个目录中都会生成一个 `.a` 文件,这是待会要用到的静态链接库。
517517

518518
<figure markdown="span">

0 commit comments

Comments
 (0)