Skip to content

Testing notebooks with pytest #6

Testing notebooks with pytest

Testing notebooks with pytest #6

name: Testing notebooks with pytest
on:
workflow_dispatch:
#push:
# branches:
# - "*"
#pull_request:
# branches:
# - "*"
jobs:
test-notebook:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install jupyter
pip install pytest nbmake nbformat
## Later move the above to a requrements.txt and run the below
## pip install -r requirements.txt
- name: Generate configuration file from secrets
env:
NOTEBOOK_GCP_PROJECT_ID: ${{ NOTEBOOK_GCP_PROJECT_ID }}

Check failure on line 34 in .github/workflows/check-jupyter-wip.yml

View workflow run for this annotation

GitHub Actions / Testing notebooks with pytest

Invalid workflow file

The workflow is not valid. .github/workflows/check-jupyter-wip.yml (Line: 34, Col: 34): Unrecognized named-value: 'NOTEBOOK_GCP_PROJECT_ID'. Located at position 1 within expression: NOTEBOOK_GCP_PROJECT_ID .github/workflows/check-jupyter-wip.yml (Line: 35, Col: 32): Unrecognized named-value: 'NOTEBOOK_GCP_LOCATION'. Located at position 1 within expression: NOTEBOOK_GCP_LOCATION
NOTEBOOK_GCP_LOCATION: ${{ NOTEBOOK_GCP_LOCATION }}
run: |
echo '{' > env.json
echo ' "NOTEBOOK_GCP_PROJECT_ID": "'${NOTEBOOK_GCP_PROJECT_ID}'",' >> env.json
echo ' "NOTEBOOK_GCP_LOCATION": "'${NOTEBOOK_GCP_LOCATION}'"' >> env.json
echo '}' >> env.json
- name: Run tests with pytest
run: |
pwd
#jupyter nbconvert --to notebook --execute notebooks/GenAI/Gemini_Intro.ipynb
pytest testing/test_notebooks.py