Skip to content

Commit 3247788

Browse files
ci: Use pixi for book build (#85)
* Update GitHub Actions. - actions/checkout@v3 -> actions/checkout@v4 - actions/setup-python@v4 -> actions/setup-python@v5 * Use prefix-dev/setup-pixi to setup pixi and load environment. - Remove use of ROOT Docker image. * Use pixi commands to build Jupyter book - This significantly speeds up the build in CI by multiple minutes. * Use uvx for lint workflow. * Use root_base in Binder postBuild. * Update Binder Python to 3.12.
1 parent 18052cf commit 3247788

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

.github/workflows/deploy-jupyter-book.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ jobs:
2121

2222
build-book:
2323
runs-on: ubuntu-latest
24-
container: atlasamglab/stats-base:root6.28.04
2524

2625
steps:
27-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2827

29-
- name: Install Python dependencies
30-
run: |
31-
python -m pip install --upgrade pip setuptools wheel
32-
python -m pip install --no-deps --require-hashes --requirement book/requirements.lock
28+
- name: Set up pixi
29+
uses: prefix-dev/[email protected]
30+
with:
31+
cache: true
32+
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
3333

34-
- name: List installed Python packages
34+
- name: List installed packages
3535
run: |
36-
python -m pip list
36+
pixi list --environment book
3737
3838
- name: Set track_progress=False for notebooks
3939
run: |
@@ -42,7 +42,7 @@ jobs:
4242
4343
- name: Build the book
4444
run: |
45-
jupyter-book build book/
45+
pixi run build
4646
4747
- name: Upload jupyter book
4848
uses: actions/upload-artifact@v3

.github/workflows/lint.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,18 @@ jobs:
1515
python-version: [ '3.x' ]
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919

2020
- name: Set up Python
21-
uses: actions/setup-python@v4
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip setuptools wheel
28-
python -m pip install pre-commit
29-
pre-commit install
25+
- name: Install the latest version of uv
26+
uses: astral-sh/setup-uv@v5
27+
with:
28+
version: "latest"
3029

3130
- name: Lint with pre-commit
3231
run: |
33-
pre-commit run --all-files
32+
uvx pre-commit run --all-files

binder/postBuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ conda config --add channels conda-forge
88
conda config --set channel_priority strict
99

1010
# Use mamba to speed up install
11-
mamba install --yes root
11+
mamba install --yes root_base

binder/runtime.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-3.10
1+
python-3.12

0 commit comments

Comments
 (0)