diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24f6b4698..8ddfb4a22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,51 +121,4 @@ jobs: file: ./coverage.xml flags: unittests name: codecov-umbrella - fail_ci_if_error: true - - Notebooks: - runs-on: ubuntu-latest - needs: [Linting, Typing, Pytests] - strategy: - 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","streaming.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"] - env: - COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }} - NLTK_DATA: /tmp/nltk_data - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.11.x - # - name: Poetry cache - # uses: actions/cache@v3 - # with: - # path: ~/.cache/pypoetry - # key: poetry-cache-${{ runner.os }}-3.11.x-${{ env.POETRY_VERSION }} - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - name: Install dependencies - run: | - make full; - poetry add "openai>=1.2.4" jupyter nbconvert cohere; - - name: Check for pypdfium2 - run: poetry run pip show pypdfium2 - - name: Huggingface Hub Login - run: poetry run huggingface-cli login --token $HUGGINGFACE_API_KEY - - name: download nltk data - run: | - mkdir /tmp/nltk_data; - poetry run python -m nltk.downloader -d /tmp/nltk_data punkt; - - name: Use venv - run: source .venv/bin/activate - - name: Execute notebooks and check for errors - run: bash ./.github/workflows/scripts/run_notebooks.sh ${{ matrix.notebook }} + fail_ci_if_error: true \ No newline at end of file diff --git a/.github/workflows/examples_check.yml b/.github/workflows/examples_check.yml index d700dc3cf..4c1d4ab07 100644 --- a/.github/workflows/examples_check.yml +++ b/.github/workflows/examples_check.yml @@ -3,6 +3,10 @@ name: Notebook Execution and Error Check on: schedule: - cron: "0 0 * * *" + push: + branches: + - main + - dev workflow_dispatch: # This enables manual triggering jobs: @@ -19,16 +23,16 @@ jobs: NLTK_DATA: /tmp/nltk_data steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.11.x - - name: Poetry cache - uses: actions/cache@v3 - with: - path: ~/.cache/pypoetry - key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }} + # - name: Poetry cache + # uses: actions/cache@v3 + # with: + # path: ~/.cache/pypoetry + # key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }} - name: Install Poetry uses: snok/install-poetry@v1 with: @@ -48,7 +52,7 @@ jobs: mkdir /tmp/nltk_data; poetry run python -m nltk.downloader -d /tmp/nltk_data punkt; - name: Use venv - run: source $VENV + run: source .venv/bin/activate - name: Execute notebooks and check for errors run: bash ./.github/workflows/scripts/run_notebooks.sh ${{ matrix.notebook }} diff --git a/.github/workflows/scripts/update_notebook_matrix.sh b/.github/workflows/scripts/update_notebook_matrix.sh index 0f79a63aa..f35f2c773 100755 --- a/.github/workflows/scripts/update_notebook_matrix.sh +++ b/.github/workflows/scripts/update_notebook_matrix.sh @@ -16,7 +16,4 @@ notebook_names="${notebook_names%,}]" # find line that begins with "notebook:" and replace it with notebook: $notebook_names sed "s/notebook: \[.*\]/notebook: $notebook_names/" .github/workflows/examples_check.yml > .github/workflows/examples_check.yml.tmp -mv .github/workflows/examples_check.yml.tmp .github/workflows/examples_check.yml - -sed "s/notebook: \[.*\]/notebook: $notebook_names/" .github/workflows/ci.yml > .github/workflows/ci.yml.tmp -mv .github/workflows/ci.yml.tmp .github/workflows/ci.yml \ No newline at end of file +mv .github/workflows/examples_check.yml.tmp .github/workflows/examples_check.yml \ No newline at end of file