Skip to content

Commit 9f569b8

Browse files
kp992mmcky
andauthored
CI: Use github actions for colab testing (#184)
* use github actions for colab testing * tmp: disable build cache for full test run * Revert "tmp: disable build cache for full test run" This reverts commit 223b4e9. * try upgrade CUDA drivers * Revert "try upgrade CUDA drivers" This reverts commit 5b7e952. --------- Co-authored-by: mmcky <[email protected]>
1 parent c995915 commit 9f569b8

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/collab.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build Project on Google Collab (Execution)
2+
on: [pull_request]
3+
jobs:
4+
execution-checks:
5+
runs-on: ubuntu-latest-gpu
6+
container:
7+
image: docker://us-docker.pkg.dev/colab-images/public/runtime
8+
options: --gpus all
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
ref: ${{ github.event.pull_request.head.sha }}
13+
- name: Check nvidia drivers
14+
shell: bash -l {0}
15+
run: |
16+
nvidia-smi
17+
- name: Check python version
18+
shell: bash -l {0}
19+
run: |
20+
python --version
21+
- name: Display Pip Versions
22+
shell: bash -l {0}
23+
run: pip list
24+
- name: Download "build" folder (cache)
25+
uses: dawidd6/action-download-artifact@v3
26+
with:
27+
workflow: cache.yml
28+
branch: main
29+
name: build-cache
30+
path: _build
31+
# Install build software
32+
- name: Install Build Software
33+
shell: bash -l {0}
34+
run: |
35+
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
36+
# Build of HTML (Execution Testing)
37+
- name: Build HTML
38+
shell: bash -l {0}
39+
run: |
40+
jb build lectures --path-output ./ -n -W --keep-going
41+
- name: Upload Execution Reports
42+
uses: actions/upload-artifact@v4
43+
if: failure()
44+
with:
45+
name: execution-reports
46+
path: _build/html/reports
47+
- name: Preview Deploy to Netlify
48+
uses: nwtgck/actions-netlify@v2
49+
with:
50+
publish-dir: '_build/html/'
51+
production-branch: main
52+
github-token: ${{ secrets.GITHUB_TOKEN }}
53+
deploy-message: "Preview Deploy from GitHub Actions"
54+
env:
55+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
56+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

0 commit comments

Comments
 (0)