-
Notifications
You must be signed in to change notification settings - Fork 6
167 lines (139 loc) · 5.01 KB
/
build-docs.yml
File metadata and controls
167 lines (139 loc) · 5.01 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Build documentation
on:
repository_dispatch:
schedule:
- cron: '29 11 * * *'
pull_request:
push:
branches: [main]
workflow_call:
jobs:
cancel-superseded:
name: Cancel superseded
runs-on: ubuntu-24.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
build-docs:
name: Build ${{ matrix.package }} docs
needs: cancel-superseded
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- package: msprime
cache-version: v11
additional-setup: sudo apt-get install -y libgsl0-dev
make-command: make
- package: tsinfer
cache-version: v13
additional-setup: sudo apt-get install -y tabix
make-command: make
- package: tskit
cache-version: v16
additional-setup: sudo apt-get install -y libgsl0-dev doxygen
requirements-path: python/requirements/CI-docs/requirements.txt
make-command: make -C python
- package: tstrait
cache-version: v4
- package: tscompare
cache-version: v1
requirements-path: requirements/CI-docs-pip/requirements.txt
- package: tsbrowse
cache-version: v2
requirements-path: requirements.txt
additional-setup: source venv-latest/bin/activate && playwright install
- package: pyslim
cache-version: v6
- package: tsdate
cache-version: v8
requirements-path: docs/requirements.txt
- package: tszip
cache-version: v2
steps:
- uses: actions/checkout@v4.2.2
name: Checkout ${{ matrix.package }}
with:
ref: main
repository: tskit-dev/${{ matrix.package }}
submodules: true
fetch-depth: 0
- name: Get commit SHA1 for cache
run: git rev-parse HEAD > SHA1
- uses: actions/cache@v4.2.2
id: docs-cache
name: Docs cache
with:
path: dist
key: ${{ matrix.package }}-docs-${{ matrix.cache-version }}-${{ hashFiles('SHA1') }}
- uses: actions/setup-python@v5.4.0
if: steps.docs-cache.outputs.cache-hit != 'true'
name: Setup Python
with:
python-version: '3.11'
- name: Build virtualenv
if: steps.docs-cache.outputs.cache-hit != 'true'
run: python -m venv venv-latest
- name: Install deps
if: steps.docs-cache.outputs.cache-hit != 'true'
run: |
source venv-latest/bin/activate
pip install -r ${{ matrix.requirements-path || 'requirements/CI-docs/requirements.txt' }}
- name: Additional setup
if: steps.docs-cache.outputs.cache-hit != 'true' && matrix.additional-setup
run: ${{ matrix.additional-setup }}
- name: Build C module
if: steps.docs-cache.outputs.cache-hit != 'true' && matrix.make-command
run: |
source venv-latest/bin/activate
${{ matrix.make-command }}
- name: Build Latest Docs
if: steps.docs-cache.outputs.cache-hit != 'true'
run: |
source venv-latest/bin/activate
cd docs
make dist
git checkout .
- name: Copy docs
if: steps.docs-cache.outputs.cache-hit != 'true'
run: |
mkdir -p dist
cp -r docs/_build/html dist/latest
- name: Checkout latest stable tag
if: steps.docs-cache.outputs.cache-hit != 'true'
run: |
git fetch --tags --recurse-submodules=no
git checkout `git tag --list --sort=creatordate | grep -vi "[baC]" | tail -n1`
git submodule update --init --recursive
- name: Build virtualenv
if: steps.docs-cache.outputs.cache-hit != 'true'
run: python -m venv venv-stable
- name: Install deps
if: steps.docs-cache.outputs.cache-hit != 'true'
run: |
source venv-stable/bin/activate
[ -f ${{ matrix.requirements-path || 'requirements/CI-docs/requirements.txt' }} ] && pip install -r ${{ matrix.requirements-path || 'requirements/CI-docs/requirements.txt' }}
- name: Build C module
if: steps.docs-cache.outputs.cache-hit != 'true' && matrix.make-command
run: |
source venv-stable/bin/activate
${{ matrix.make-command }}
- name: Build Stable Docs
if: steps.docs-cache.outputs.cache-hit != 'true'
run: |
source venv-stable/bin/activate
cd docs
make dist
git checkout .
- name: Copy docs
if: steps.docs-cache.outputs.cache-hit != 'true'
run: |
cp -r docs/_build/html dist/stable
- name: Upload docs
uses: actions/upload-artifact@v4.6.1
with:
name: ${{ matrix.package }}-docs
path: dist