Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Test Execution for Google Collab #441

Merged
merged 18 commits into from
May 21, 2024
52 changes: 52 additions & 0 deletions .github/workflows/collab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Project on Google Collab (Execution)
on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest-m
container:
image: docker://us-docker.pkg.dev/colab-images/public/runtime:latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kp992 this is not fetching the same environment as what is online and I am getting it from here: https://console.cloud.google.com/artifacts/docker/colab-images/us/public/runtime

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is tricky, I read it online that :latest should be enough to fetch the recent runtime.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me too. It is frustrating it isn't exactly the same as google colab. They must deploy from a different runtime image?

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check python version
shell: bash -l {0}
run: |
python --version
- name: Display Pip Versions
shell: bash -l {0}
run: pip list
- name: Download "build" folder (cache)
uses: dawidd6/action-download-artifact@v3
with:
workflow: cache.yml
branch: main
name: build-cache
path: _build
# Install build software
- name: Install Build Software
shell: bash -l {0}
run: |
pip install jupyter-book==0.15.1 docutils==0.17.1 quantecon-book-theme==0.7.1 sphinx-tojupyter==0.3.0 sphinxext-rediraffe==0.2.7 sphinx-exercise==0.4.1 sphinxcontrib-youtube==1.1.0 sphinx-togglebutton==0.3.1 arviz==0.13.0 sphinx_proof==0.1.3
# Build of HTML (Execution Testing)
- name: Build HTML
shell: bash -l {0}
run: |
jb build lectures --path-output ./ -n -W --keep-going
- name: Upload Execution Reports
uses: actions/upload-artifact@v4
if: failure()
with:
name: execution-reports
path: _build/html/reports
- name: Preview Deploy to Netlify
uses: nwtgck/actions-netlify@v2
with:
publish-dir: '_build/html/'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Preview Deploy from GitHub Actions"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
5 changes: 3 additions & 2 deletions lectures/inflation_history.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ This lecture also requires `pandas >= 2.1.4`

```{code-cell} ipython3
:tags: [hide-output]
import pandas
from packaging.version import Version
import pandas as pd
if Version(pd.__version__) < Version('2.1.4'):
from importlib import reload
if Version(pandas.__version__) < Version('2.1.4'):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed now right?

!pip install pandas==2.1.4
reload(pandas)
```
Expand Down
Loading