diff --git a/.github/workflows/examples_check.yml b/.github/workflows/examples_check.yml index 6dea3d80c..c5cf255a9 100644 --- a/.github/workflows/examples_check.yml +++ b/.github/workflows/examples_check.yml @@ -1,6 +1,7 @@ name: Notebook Execution and Error Check on: + pull_request: schedule: - cron: "0 0 * * *" push: @@ -13,6 +14,7 @@ jobs: execute_notebooks: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: # this line is automatically generated by the script in .github/workflows/scripts/update_notebook_matrix.sh notebook: ["bug_free_python_code.ipynb","check_for_pii.ipynb","competitors_check.ipynb","extracting_entities.ipynb","generate_structured_data.ipynb","generate_structured_data_cohere.ipynb","guardrails_with_chat_models.ipynb","input_validation.ipynb","llamaindex-output-parsing.ipynb","no_secrets_in_generated_text.ipynb","provenance.ipynb","recipe_generation.ipynb","regex_validation.ipynb","response_is_on_topic.ipynb","secrets_detection.ipynb","select_choice_based_on_action.ipynb","syntax_error_free_sql.ipynb","text_summarization_quality.ipynb","toxic_language.ipynb","translation_to_specific_language.ipynb","translation_with_quality_check.ipynb","valid_chess_moves.ipynb","value_within_distribution.ipynb"] @@ -67,4 +69,3 @@ jobs: run: | source .venv/bin/activate bash ./.github/workflows/scripts/run_notebooks.sh ${{ matrix.notebook }} - diff --git a/.github/workflows/scripts/run_notebooks.sh b/.github/workflows/scripts/run_notebooks.sh index 51ff78a52..ae6be203a 100755 --- a/.github/workflows/scripts/run_notebooks.sh +++ b/.github/workflows/scripts/run_notebooks.sh @@ -14,6 +14,15 @@ notebook="$1" invalid_notebooks=("llamaindex-output-parsing.ipynb" "competitors_check.ipynb" "guardrails_server.ipynb" "valid_chess_moves.ipynb") if [[ ! " ${invalid_notebooks[@]} " =~ " ${notebook} " ]]; then echo "Processing $notebook..." + + echo "Guardrails Hub Init File Contents: " + cat /home/runner/work/guardrails/guardrails/.venv/lib/python3.11/site-packages/guardrails/hub/__init__.py + + # Example install + export GUARDRAILS_TOKEN=$(cat ~/.guardrailsrc| awk -F 'token=' '{print $2}' | awk '{print $1}' | tr -d '\n') + pip install -vvv --index-url=https://__token__:$GUARDRAILS_TOKEN@pypi.guardrailsai.com/simple --extra-index-url=https://pypi.org/simple \ + guardrails-grhub-toxic-language + # poetry run jupyter nbconvert --to notebook --execute "$notebook" jupyter nbconvert --to notebook --execute "$notebook" if [ $? -ne 0 ]; then