Skip to content

Commit fbddd6e

Browse files
committed
Use conda to build and install package for docs workflow
1 parent 2f6d1f2 commit fbddd6e

File tree

1 file changed

+36
-8
lines changed

1 file changed

+36
-8
lines changed

.github/workflows/docs.yml

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,56 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v4
2323

24-
- name: Setup Python
25-
uses: actions/setup-python@v5
26-
with:
27-
python-version: 3.x
24+
- name: Setup Conda Base
25+
run: |
26+
sudo rm -rf /usr/share/miniconda \
27+
&& sudo rm -rf /usr/local/miniconda \
28+
&& curl -SL -o miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh \
29+
&& bash miniforge.sh -b -f -p ~/conda \
30+
&& source ~/conda/etc/profile.d/conda.sh \
31+
&& conda activate base \
32+
&& conda update -n base --yes conda
33+
34+
- name: Install Dependencies
35+
run: |
36+
source ~/conda/etc/profile.d/conda.sh \
37+
&& conda create --yes -n docs python==3.12 \
38+
&& conda activate docs \
39+
&& conda install --yes --file packaging/conda_build_requirements.txt
2840
29-
- name: Create Cache ID
41+
- name: Install Package
42+
run: |
43+
source ~/conda/etc/profile.d/conda.sh \
44+
&& conda activate docs \
45+
&& pip install .
46+
47+
- name: Run Serial Tests
48+
run: |
49+
source ~/conda/etc/profile.d/conda.sh \
50+
&& conda activate docs \
51+
&& export OMP_NUM_THREADS=1 \
52+
&& mkdir -p test \
53+
&& pushd test >/dev/null 2>&1 \
54+
&& python3 -c 'import flacarray.tests; flacarray.tests.run()' \
55+
&& popd >/dev/null 2>&1
56+
57+
- name: Create Docs Cache ID
3058
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
3159

32-
- name: Setup Cache
60+
- name: Setup Docs Cache
3361
uses: actions/cache@v4
3462
with:
3563
key: mkdocs-material-${{ env.cache_id }}
3664
path: .cache
3765
restore-keys: |
3866
mkdocs-material-
3967
40-
- name: Install Dependencies
68+
- name: Install Docs Dependencies
4169
# AttributeError: 'MathBlockParser' object has no attribute 'parse_axt_heading'
4270
# https://github.com/jupyter/nbconvert/issues/2198
4371
# mistune = "<3.1"
4472
run: |
45-
pip install mkdocs mkdocstrings mkdocstrings-python mkdocs-material mkdocs-material-extensions mkdocs-jupyter "mistune<3.1"
73+
conda install --yes mkdocs mkdocstrings mkdocstrings-python mkdocs-material mkdocs-material-extensions mkdocs-jupyter "mistune<3.1"
4674
git config user.name 'github-actions[bot]'
4775
git config user.email 'github-actions[bot]@users.noreply.github.com'
4876

0 commit comments

Comments
 (0)