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