-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (99 loc) · 2.9 KB
/
ci.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
BUILD_DIR: build
SCRIPTS_DIR: scripts
DOCS_DIR: docs
CPP_DOCS_DIR: docs/cppdocs
PY_DOCS_DIR: docs/pydocs/html
BUILD_ARTIFACTS_ID: build-artifacts
CPP_DOCS_ARTIFACTS_ID: cpp-docs
PY_DOCS_ARTIFACTS_ID: py-docs
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Initialize Submodules
run: git submodule init
- name: Update Submodules
run: git submodule update
- name: Build
run: source ${{ env.SCRIPTS_DIR }}/build.sh
- name: Test
run: source ${{ env.SCRIPTS_DIR }}/tests.sh
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_ARTIFACTS_ID }}
path: ${{ env.BUILD_DIR }}/*.so
if-no-files-found: error
retention-days: 1/*.so
build_and_upload_cpp_docs:
needs: build_and_test
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Cpp docs with Doxygen
uses: mattnotmitt/doxygen-action@edge
with:
working-directory: ${{ env.DOCS_DIR }}
doxyfile-path: ./Doxyfile
- name: Upload Cpp docs
uses: actions/upload-artifact@v4
with:
name: ${{ env.CPP_DOCS_ARTIFACTS_ID }}
path: ${{ env.CPP_DOCS_DIR }}
if-no-files-found: error
retention-days: 1
build_and_upload_py_docs:
needs: build_and_test
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.BUILD_ARTIFACTS_ID }}
path: ${{ env.BUILD_DIR }}
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: |
cd ${{ env.DOCS_DIR }} && \
python setup.py
- name: Build Py docs with Sphinx
run: |
cd ${{ env.DOCS_DIR }} && \
make html
- name: Navigate to root directory
run: cd ..
- name: Upload Py docs
uses: actions/upload-artifact@v4
with:
name: ${{ env.PY_DOCS_ARTIFACTS_ID }}
path: ${{ env.PY_DOCS_DIR }}
if-no-files-found: error
retention-days: 1
pages_deployment:
needs: [build_and_upload_cpp_docs, build_and_upload_py_docs]
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download docs
uses: actions/download-artifact@v4
with:
pattern: "*-docs"
path: ${{ env.DOCS_DIR }}
- name: Deploy Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.DOCS_DIR }}