Skip to content

Commit ef776da

Browse files
committed
DOC: Replace micromamba setup with Conda environment management in CI workflow
1 parent 358eba3 commit ef776da

File tree

2 files changed

+107
-99
lines changed

2 files changed

+107
-99
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/docbuild-and-upload.yml

Lines changed: 107 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ jobs:
2626
runs-on: ubuntu-24.04
2727

2828
concurrency:
29-
# https://github.community/t/concurrecy-not-work-for-push/183068/7
3029
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-web-docs
3130
cancel-in-progress: true
3231

@@ -35,67 +34,110 @@ jobs:
3534
shell: bash -el {0}
3635

3736
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v6
40-
with:
41-
fetch-depth: 0
42-
43-
- name: Set up Conda
44-
uses: ./.github/actions/setup-conda
45-
with:
46-
cache-buster: ${{ github.sha }}
47-
- name: Build Pandas
48-
uses: ./.github/actions/build_pandas
49-
50-
- name: Extra installs
51-
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
52-
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
53-
54-
- name: Test website
55-
run: python -m pytest web/
56-
57-
- name: Build website
58-
run: python web/pandas_web.py web/pandas --target-path=web/build
59-
60-
- name: Build documentation
61-
run: doc/make.py --warnings-are-errors
62-
63-
- name: Build the interactive terminal
64-
working-directory: web/interactive_terminal
65-
run: jupyter lite build
66-
67-
- name: Build documentation zip
68-
run: doc/make.py zip_html
69-
70-
- name: Install ssh key
71-
run: |
72-
mkdir -m 700 -p ~/.ssh
73-
echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa
74-
chmod 600 ~/.ssh/id_rsa
75-
echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFjYkJBk7sos+r7yATODogQc3jUdW1aascGpyOD4bohj8dWjzwLJv/OJ/fyOQ5lmj81WKDk67tGtqNJYGL9acII=" > ~/.ssh/known_hosts
76-
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
77-
78-
- name: Copy cheatsheets into site directory
79-
run: cp doc/cheatsheet/Pandas_Cheat_Sheet* web/build/
80-
81-
- name: Upload web
82-
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' --exclude='benchmarks' web/build/ web@${{ secrets.server_ip }}:/var/www/html
83-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
84-
85-
- name: Upload dev docs
86-
run: rsync -az --delete doc/build/html/ web@${{ secrets.server_ip }}:/var/www/html/pandas-docs/dev
87-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
88-
89-
- name: Upload prod docs
90-
run: rsync -az --delete doc/build/html/ web@${{ secrets.server_ip }}:/var/www/html/pandas-docs/version/${GITHUB_REF_NAME:1}
91-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
92-
93-
- name: Move docs into site directory
94-
run: mv doc/build/html web/build/docs
95-
96-
- name: Save website as an artifact
97-
uses: actions/upload-artifact@v5
98-
with:
99-
name: website
100-
path: web/build
101-
retention-days: 14
37+
- name: Checkout
38+
uses: actions/checkout@v6
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Download micromamba (with retries)
43+
shell: bash
44+
run: |
45+
set -euo pipefail
46+
RETRIES=5
47+
URL="https://micromamba.snakepit.net/api/micromamba/linux-64/latest"
48+
OUT="$RUNNER_TEMP/micromamba.tar.bz2"
49+
i=0
50+
until [ $i -ge $RETRIES ]
51+
do
52+
echo "Attempt $((i+1))..."
53+
if curl -fSL "$URL" -o "$OUT"; then
54+
echo "Downloaded micromamba"
55+
break
56+
fi
57+
i=$((i+1))
58+
sleep $((i * 2))
59+
done
60+
if [ ! -f "$OUT" ]; then
61+
echo "Failed to download micromamba after $RETRIES attempts"
62+
exit 1
63+
fi
64+
mkdir -p "$RUNNER_TEMP/micromamba"
65+
tar -xjf "$OUT" -C "$RUNNER_TEMP/micromamba" --strip-components=1
66+
export MAMBA_ROOT_PREFIX="$RUNNER_TEMP/micromamba-root"
67+
mkdir -p "$MAMBA_ROOT_PREFIX"
68+
echo "Adding micromamba to PATH"
69+
echo "$RUNNER_TEMP/micromamba/bin" >> $GITHUB_PATH
70+
71+
- name: Create env with micromamba
72+
run: |
73+
micromamba create -y -n ci-env python=3.10 -f ${{ env.ENV_FILE }}
74+
micromamba activate ci-env
75+
echo "PATH updated for ci-env"
76+
77+
- name: Build Pandas
78+
run: |
79+
micromamba activate ci-env
80+
# Replace with your actual build command from build_pandas action
81+
python setup.py build
82+
83+
- name: Extra installs
84+
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
85+
86+
- name: Test website
87+
run: |
88+
micromamba activate ci-env
89+
python -m pytest web/
90+
91+
- name: Build website
92+
run: |
93+
micromamba activate ci-env
94+
python web/pandas_web.py web/pandas --target-path=web/build
95+
96+
- name: Build documentation
97+
run: |
98+
micromamba activate ci-env
99+
doc/make.py --warnings-are-errors
100+
101+
- name: Build the interactive terminal
102+
working-directory: web/interactive_terminal
103+
run: |
104+
micromamba activate ci-env
105+
jupyter lite build
106+
107+
- name: Build documentation zip
108+
run: |
109+
micromamba activate ci-env
110+
doc/make.py zip_html
111+
112+
- name: Install ssh key
113+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
114+
run: |
115+
mkdir -m 700 -p ~/.ssh
116+
echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa
117+
chmod 600 ~/.ssh/id_rsa
118+
echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFjYkJBk7sos+r7yATODogQc3jUdW1aascGpyOD4bohj8dWjzwLJv/OJ/fyOQ5lmj81WKDk67tGtqNJYGL9acII=" > ~/.ssh/known_hosts
119+
120+
- name: Copy cheatsheets into site directory
121+
run: cp doc/cheatsheet/Pandas_Cheat_Sheet* web/build/
122+
123+
- name: Upload web
124+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
125+
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' --exclude='benchmarks' web/build/ web@${{ secrets.server_ip }}:/var/www/html
126+
127+
- name: Upload dev docs
128+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
129+
run: rsync -az --delete doc/build/html/ web@${{ secrets.server_ip }}:/var/www/html/pandas-docs/dev
130+
131+
- name: Upload prod docs
132+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
133+
run: rsync -az --delete doc/build/html/ web@${{ secrets.server_ip }}:/var/www/html/pandas-docs/version/${GITHUB_REF_NAME:1}
134+
135+
- name: Move docs into site directory
136+
run: mv doc/build/html web/build/docs
137+
138+
- name: Save website as an artifact
139+
uses: actions/upload-artifact@v5
140+
with:
141+
name: website
142+
path: web/build
143+
retention-days: 14

0 commit comments

Comments
 (0)