-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Copyright 2023 Stanford University Convex Optimization Group | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
name: Build the Jupyter Book | ||
|
||
description: "Build jupyter book" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
kernel: | ||
description: 'Jupyter kernel' | ||
type: string | ||
required: false | ||
default: 'cvx' | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
#- name: Check out repository | ||
#- uses: actions/checkout@v4 | ||
|
||
- uses: cvxgrp/.github/actions/uv/setup@main | ||
|
||
- name: Install jupyterbook | ||
shell: bash | ||
run: | | ||
uv pip install jupyter-book | ||
# There is no need to create the kernel if the jupyter book is installed within the same virtual environment as the package | ||
# poetry run python -m ipykernel install --user --name=${{ inputs.kernel || 'cvx' }} | ||
# Build the book | ||
- name: Build the book | ||
shell: bash | ||
run: | | ||
uv run jupyter-book clean book | ||
uv run jupyter-book build book | ||
# Create this weird .nojekyll file | ||
# We do this in the book action... This is the wrong place | ||
# see https://jupyterbook.org/en/stable/publish/gh-pages.html#option-1-copy-and-paste-your-books-build-contents-into-a-new-folder | ||
# touch book/_build/html/.nojekyll | ||
# Upload the book | ||
- name: Archive book | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: book | ||
path: book/_build/html/ | ||
retention-days: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright 2023 Stanford University Convex Optimization Group | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
name: Setup the Python Environment | ||
|
||
description: "Construct a Python environment for ci/cd using uv" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
python-version: | ||
description: 'Python version' | ||
type: string | ||
required: false | ||
default: '3.12' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
# Install a specific version of uv. | ||
version: "0.5.4" | ||
|
||
- name: Set up Python ${{ inputs.python-version || '3.12' }} | ||
shell: bash | ||
run: | | ||
uv python install ${{ inputs.python-version || '3.12' }} | ||
- name: Install the project | ||
shell: bash | ||
run: | | ||
uv sync --all-extras --dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters