-
Notifications
You must be signed in to change notification settings - Fork 6
140 lines (122 loc) · 3.5 KB
/
docs.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Build and deploy manual
on:
pull_request:
branches: [main, dev]
release:
types: [created]
jobs:
builddocs:
name: Build manual
runs-on: ubuntu-20.04
strategy:
matrix:
compiler: [gcc]
python-version: ["3.12"]
rust: [1.62.1]
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Set up rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Install cbindgen
uses: baptiste0928/cargo-install@v3
with:
crate: cbindgen
version: "=0.24.3"
# We install the R dependencies first
# Later, Python dependencies will go into the same place.
# Python will silently update dependencies if needed,
# and they'll get cached, too.
- name: Cache dependancies
id: cache
uses: actions/cache@v4
with:
path: |
~/.local
key: ${{ matrix.python }}-${{ hashFiles('doc/development.txt') }}-V0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install apt dependencies
run: |
sudo apt install --fix-missing -y libgsl-dev cmake
- name: Set GCC as compiler
if: matrix.compiler == 'gcc'
run: |
echo "CC=gcc-9" >> $GITHUB_ENV
echo "CXX=g++-9" >> $GITHUB_ENV
- name: Test compiler
if: matrix.compiler == 'gcc'
run: |
$CXX -v
$CC -v
- name: Edit PATH
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Python dependencies
run: |
python -m pip install --user --upgrade pip
# These are needed to install black:
python -m pip install --user --upgrade setuptools wheel
python -m pip install --user --upgrade -r requirements/development.txt
- name: rustc version
run: |
rustc --version
- name: cbindgen version
run: |
cbindgen --version
- name: Build module
run: |
python -m pip install -e .
- name: Build the docs
working-directory: doc
run: |
make
- name: Move built HTML docs
if: github.event_name == 'release'
working-directory: doc
run: |
mv _build/html ../docs_output
- name: Upload artifacts
if: github.event_name == 'release'
uses: actions/upload-artifact@v4
with:
name: docs_output
path: docs_output/
deploy:
name: deploy
needs: builddocs
if: github.event_name == 'release'
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4.1.7
with:
# Artifact name
name: docs_output # optional
# Destination path
path: docs_output # optional
- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@v3
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS }}
with:
build_dir: docs_output/